{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "Bad key \"text.kerning_factor\" on line 4 in\n",
      "/nobackup/sbhusha1/sw/miniconda3/envs/bhushan_PY3/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle.\n",
      "You probably need to get an updated matplotlibrc file from\n",
      "https://github.com/matplotlib/matplotlib/blob/v3.1.3/matplotlibrc.template\n",
      "or from the matplotlib source distribution\n"
     ]
    }
   ],
   "source": [
    "import os,sys,glob\n",
    "from pygeotools.lib import malib\n",
    "import geopandas as gpd\n",
    "from imview import pltlib\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import rpcm\n",
    "from tqdm import tqdm\n",
    "from p_tqdm import p_map,p_umap\n",
    "import pandas as pd\n",
    "from multiprocessing import cpu_count\n",
    "from skysat_stereo import asp_utils as asp\n",
    "from skysat_stereo import skysat "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "asp.camera_reprojection_error_stats_df?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Case 1: Bundle adjustment using camera obtained from 10 m DEM\n",
    "\n",
    "no robust threshold, no camera weight, no parameter tolerance\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fba7e916dae145458fa440076399fa13",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "init_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_no_robust_threahold_cam_wt0/run-initial_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>297.670674</td>\n",
       "      <td>297.667621</td>\n",
       "      <td>7.360739</td>\n",
       "      <td>19.904727</td>\n",
       "      <td>1.332610</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>1.136318</td>\n",
       "      <td>5.632678</td>\n",
       "      <td>2.248180</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>797.392087</td>\n",
       "      <td>797.391593</td>\n",
       "      <td>18.863889</td>\n",
       "      <td>64.350225</td>\n",
       "      <td>1.327428</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>0.876128</td>\n",
       "      <td>9.140801</td>\n",
       "      <td>4.132336</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>606.671866</td>\n",
       "      <td>606.671702</td>\n",
       "      <td>13.832706</td>\n",
       "      <td>43.895696</td>\n",
       "      <td>1.765301</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>0.743774</td>\n",
       "      <td>6.839131</td>\n",
       "      <td>3.047679</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>1091.100096</td>\n",
       "      <td>1091.096886</td>\n",
       "      <td>10.989787</td>\n",
       "      <td>39.771488</td>\n",
       "      <td>1.756563</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>0.902891</td>\n",
       "      <td>8.642462</td>\n",
       "      <td>3.869786</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>689.207895</td>\n",
       "      <td>689.202708</td>\n",
       "      <td>12.100672</td>\n",
       "      <td>36.260374</td>\n",
       "      <td>1.613689</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>1.192010</td>\n",
       "      <td>6.246969</td>\n",
       "      <td>2.527479</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>208.346355</td>\n",
       "      <td>208.344149</td>\n",
       "      <td>5.190641</td>\n",
       "      <td>8.775557</td>\n",
       "      <td>2.777135</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>1.875839</td>\n",
       "      <td>7.568493</td>\n",
       "      <td>2.846327</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>107.675981</td>\n",
       "      <td>107.669953</td>\n",
       "      <td>3.677115</td>\n",
       "      <td>5.328733</td>\n",
       "      <td>1.465054</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>1.517690</td>\n",
       "      <td>4.521464</td>\n",
       "      <td>1.501887</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>254.576283</td>\n",
       "      <td>254.574545</td>\n",
       "      <td>4.042884</td>\n",
       "      <td>11.977195</td>\n",
       "      <td>1.425692</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>1.132042</td>\n",
       "      <td>3.910024</td>\n",
       "      <td>1.388991</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>867.425983</td>\n",
       "      <td>867.422957</td>\n",
       "      <td>4.258796</td>\n",
       "      <td>22.041762</td>\n",
       "      <td>1.093660</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>1.232185</td>\n",
       "      <td>4.121481</td>\n",
       "      <td>1.444648</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>138.225976</td>\n",
       "      <td>138.219066</td>\n",
       "      <td>3.342914</td>\n",
       "      <td>4.403954</td>\n",
       "      <td>1.145942</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>1.615534</td>\n",
       "      <td>4.838674</td>\n",
       "      <td>1.611570</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.003053   297.670674   297.667621   7.360739  19.904727   \n",
       "1     4043  0.000494   797.392087   797.391593  18.863889  64.350225   \n",
       "2     4497  0.000164   606.671866   606.671702  13.832706  43.895696   \n",
       "3     4130  0.003210  1091.100096  1091.096886  10.989787  39.771488   \n",
       "4     4246  0.005187   689.207895   689.202708  12.100672  36.260374   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.002206   208.346355   208.344149   5.190641   8.775557   \n",
       "180   3707  0.006028   107.675981   107.669953   3.677115   5.328733   \n",
       "181   4445  0.001738   254.576283   254.574545   4.042884  11.977195   \n",
       "182   4559  0.003026   867.425983   867.422957   4.258796  22.041762   \n",
       "183   3838  0.006910   138.225976   138.219066   3.342914   4.403954   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332610  2.169127  2.169127  1.136318  5.632678  2.248180  0.003053   \n",
       "1    1.327428  1.948240  1.948240  0.876128  9.140801  4.132336  0.000494   \n",
       "2    1.765301  2.172162  2.172162  0.743774  6.839131  3.047679  0.000164   \n",
       "3    1.756563  2.250562  2.250562  0.902891  8.642462  3.869786  0.003210   \n",
       "4    1.613689  2.715130  2.715130  1.192010  6.246969  2.527479  0.005187   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.777135  3.940981  3.940981  1.875839  7.568493  2.846327  0.002206   \n",
       "180  1.465054  2.805216  2.805216  1.517690  4.521464  1.501887  0.006028   \n",
       "181  1.425692  2.535071  2.535071  1.132042  3.910024  1.388991  0.001738   \n",
       "182  1.093660  2.293505  2.293505  1.232185  4.121481  1.444648  0.003026   \n",
       "183  1.145942  2.495953  2.495953  1.615534  4.838674  1.611570  0.006910   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.009337</td>\n",
       "      <td>1586.922621</td>\n",
       "      <td>1586.913284</td>\n",
       "      <td>11.728639</td>\n",
       "      <td>54.578254</td>\n",
       "      <td>1.849336</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>1.191957</td>\n",
       "      <td>8.952492</td>\n",
       "      <td>3.880267</td>\n",
       "      <td>0.009337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.028170</td>\n",
       "      <td>5350.087198</td>\n",
       "      <td>5350.086310</td>\n",
       "      <td>9.951353</td>\n",
       "      <td>137.854460</td>\n",
       "      <td>1.034153</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>0.921782</td>\n",
       "      <td>10.570077</td>\n",
       "      <td>5.228412</td>\n",
       "      <td>0.028170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000007</td>\n",
       "      <td>17.017930</td>\n",
       "      <td>17.016424</td>\n",
       "      <td>1.548698</td>\n",
       "      <td>1.497151</td>\n",
       "      <td>0.411130</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.087845</td>\n",
       "      <td>1.439080</td>\n",
       "      <td>0.675617</td>\n",
       "      <td>0.000007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000598</td>\n",
       "      <td>305.096271</td>\n",
       "      <td>305.093050</td>\n",
       "      <td>5.181919</td>\n",
       "      <td>15.633537</td>\n",
       "      <td>1.170797</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>0.571162</td>\n",
       "      <td>3.821715</td>\n",
       "      <td>1.475505</td>\n",
       "      <td>0.000598</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.001715</td>\n",
       "      <td>616.924352</td>\n",
       "      <td>616.921670</td>\n",
       "      <td>9.262133</td>\n",
       "      <td>29.014861</td>\n",
       "      <td>1.639866</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>1.011007</td>\n",
       "      <td>5.472475</td>\n",
       "      <td>2.140856</td>\n",
       "      <td>0.001715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.006019</td>\n",
       "      <td>1005.461775</td>\n",
       "      <td>1005.458903</td>\n",
       "      <td>13.631376</td>\n",
       "      <td>51.271993</td>\n",
       "      <td>2.197642</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>1.434870</td>\n",
       "      <td>8.566359</td>\n",
       "      <td>3.608012</td>\n",
       "      <td>0.006019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.213001</td>\n",
       "      <td>55498.001512</td>\n",
       "      <td>55497.996204</td>\n",
       "      <td>64.996068</td>\n",
       "      <td>1572.526637</td>\n",
       "      <td>6.733989</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>4.950465</td>\n",
       "      <td>65.216577</td>\n",
       "      <td>31.890185</td>\n",
       "      <td>0.213001</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min           max           ptp        mean  \\\n",
       "count   184.000000  184.000000    184.000000    184.000000  184.000000   \n",
       "mean   4275.956522    0.009337   1586.922621   1586.913284   11.728639   \n",
       "std    1022.520436    0.028170   5350.087198   5350.086310    9.951353   \n",
       "min    1013.000000    0.000007     17.017930     17.016424    1.548698   \n",
       "25%    3804.000000    0.000598    305.096271    305.093050    5.181919   \n",
       "50%    4266.000000    0.001715    616.924352    616.921670    9.262133   \n",
       "75%    4703.500000    0.006019   1005.461775   1005.458903   13.631376   \n",
       "max    7479.000000    0.213001  55498.001512  55497.996204   64.996068   \n",
       "\n",
       "               std        nmad         med      median         p16  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     54.578254    1.849336    2.710945    2.710945    1.191957   \n",
       "std     137.854460    1.034153    1.636611    1.636611    0.921782   \n",
       "min       1.497151    0.411130    0.369011    0.369011    0.087845   \n",
       "25%      15.633537    1.170797    1.619642    1.619642    0.571162   \n",
       "50%      29.014861    1.639866    2.427164    2.427164    1.011007   \n",
       "75%      51.271993    2.197642    3.441582    3.441582    1.434870   \n",
       "max    1572.526637    6.733989    9.153704    9.153704    4.950465   \n",
       "\n",
       "              p84      spread        mode  \n",
       "count  184.000000  184.000000  184.000000  \n",
       "mean     8.952492    3.880267    0.009337  \n",
       "std     10.570077    5.228412    0.028170  \n",
       "min      1.439080    0.675617    0.000007  \n",
       "25%      3.821715    1.475505    0.000598  \n",
       "50%      5.472475    2.140856    0.001715  \n",
       "75%      8.566359    3.608012    0.006019  \n",
       "max     65.216577   31.890185    0.213001  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>297.670674</td>\n",
       "      <td>297.667621</td>\n",
       "      <td>7.360739</td>\n",
       "      <td>19.904727</td>\n",
       "      <td>1.332610</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>1.136318</td>\n",
       "      <td>5.632678</td>\n",
       "      <td>2.248180</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>797.392087</td>\n",
       "      <td>797.391593</td>\n",
       "      <td>18.863889</td>\n",
       "      <td>64.350225</td>\n",
       "      <td>1.327428</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>0.876128</td>\n",
       "      <td>9.140801</td>\n",
       "      <td>4.132336</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>606.671866</td>\n",
       "      <td>606.671702</td>\n",
       "      <td>13.832706</td>\n",
       "      <td>43.895696</td>\n",
       "      <td>1.765301</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>0.743774</td>\n",
       "      <td>6.839131</td>\n",
       "      <td>3.047679</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>1091.100096</td>\n",
       "      <td>1091.096886</td>\n",
       "      <td>10.989787</td>\n",
       "      <td>39.771488</td>\n",
       "      <td>1.756563</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>0.902891</td>\n",
       "      <td>8.642462</td>\n",
       "      <td>3.869786</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>689.207895</td>\n",
       "      <td>689.202708</td>\n",
       "      <td>12.100672</td>\n",
       "      <td>36.260374</td>\n",
       "      <td>1.613689</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>1.192010</td>\n",
       "      <td>6.246969</td>\n",
       "      <td>2.527479</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>208.346355</td>\n",
       "      <td>208.344149</td>\n",
       "      <td>5.190641</td>\n",
       "      <td>8.775557</td>\n",
       "      <td>2.777135</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>1.875839</td>\n",
       "      <td>7.568493</td>\n",
       "      <td>2.846327</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>107.675981</td>\n",
       "      <td>107.669953</td>\n",
       "      <td>3.677115</td>\n",
       "      <td>5.328733</td>\n",
       "      <td>1.465054</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>1.517690</td>\n",
       "      <td>4.521464</td>\n",
       "      <td>1.501887</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>254.576283</td>\n",
       "      <td>254.574545</td>\n",
       "      <td>4.042884</td>\n",
       "      <td>11.977195</td>\n",
       "      <td>1.425692</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>1.132042</td>\n",
       "      <td>3.910024</td>\n",
       "      <td>1.388991</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>867.425983</td>\n",
       "      <td>867.422957</td>\n",
       "      <td>4.258796</td>\n",
       "      <td>22.041762</td>\n",
       "      <td>1.093660</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>1.232185</td>\n",
       "      <td>4.121481</td>\n",
       "      <td>1.444648</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>138.225976</td>\n",
       "      <td>138.219066</td>\n",
       "      <td>3.342914</td>\n",
       "      <td>4.403954</td>\n",
       "      <td>1.145942</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>1.615534</td>\n",
       "      <td>4.838674</td>\n",
       "      <td>1.611570</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>166 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.003053   297.670674   297.667621   7.360739  19.904727   \n",
       "1     4043  0.000494   797.392087   797.391593  18.863889  64.350225   \n",
       "2     4497  0.000164   606.671866   606.671702  13.832706  43.895696   \n",
       "3     4130  0.003210  1091.100096  1091.096886  10.989787  39.771488   \n",
       "4     4246  0.005187   689.207895   689.202708  12.100672  36.260374   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.002206   208.346355   208.344149   5.190641   8.775557   \n",
       "180   3707  0.006028   107.675981   107.669953   3.677115   5.328733   \n",
       "181   4445  0.001738   254.576283   254.574545   4.042884  11.977195   \n",
       "182   4559  0.003026   867.425983   867.422957   4.258796  22.041762   \n",
       "183   3838  0.006910   138.225976   138.219066   3.342914   4.403954   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332610  2.169127  2.169127  1.136318  5.632678  2.248180  0.003053   \n",
       "1    1.327428  1.948240  1.948240  0.876128  9.140801  4.132336  0.000494   \n",
       "2    1.765301  2.172162  2.172162  0.743774  6.839131  3.047679  0.000164   \n",
       "3    1.756563  2.250562  2.250562  0.902891  8.642462  3.869786  0.003210   \n",
       "4    1.613689  2.715130  2.715130  1.192010  6.246969  2.527479  0.005187   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.777135  3.940981  3.940981  1.875839  7.568493  2.846327  0.002206   \n",
       "180  1.465054  2.805216  2.805216  1.517690  4.521464  1.501887  0.006028   \n",
       "181  1.425692  2.535071  2.535071  1.132042  3.910024  1.388991  0.001738   \n",
       "182  1.093660  2.293505  2.293505  1.232185  4.121481  1.444648  0.003026   \n",
       "183  1.145942  2.495953  2.495953  1.615534  4.838674  1.611570  0.006910   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[166 rows x 14 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error[init_error['median']>1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Initialised raw frame camera models have median reprojection errors for imaged point ranging between 0.4 px 9 px.\n",
    "Out of 184 cameras, 166 cameras have median pixel reprojection errors worse than 1 px.\n",
    "75% of the cameras have median pixel reprojection errors worse than 3.44 px."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "38c1b6be9a1e4390bd4bc68b13020640",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "final_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_no_robust_threahold_cam_wt0/run-final_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4278</td>\n",
       "      <td>0.002895</td>\n",
       "      <td>25.049901</td>\n",
       "      <td>25.047006</td>\n",
       "      <td>1.970162</td>\n",
       "      <td>1.737800</td>\n",
       "      <td>1.609739</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>0.344090</td>\n",
       "      <td>3.260845</td>\n",
       "      <td>1.458378</td>\n",
       "      <td>0.002895</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3993</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>21.009731</td>\n",
       "      <td>21.009175</td>\n",
       "      <td>1.128771</td>\n",
       "      <td>1.600075</td>\n",
       "      <td>0.702801</td>\n",
       "      <td>0.628768</td>\n",
       "      <td>0.628768</td>\n",
       "      <td>0.157324</td>\n",
       "      <td>2.022739</td>\n",
       "      <td>0.932707</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4455</td>\n",
       "      <td>0.000622</td>\n",
       "      <td>23.069894</td>\n",
       "      <td>23.069272</td>\n",
       "      <td>0.768609</td>\n",
       "      <td>1.435317</td>\n",
       "      <td>0.339856</td>\n",
       "      <td>0.341667</td>\n",
       "      <td>0.341667</td>\n",
       "      <td>0.114052</td>\n",
       "      <td>1.224514</td>\n",
       "      <td>0.555231</td>\n",
       "      <td>0.000622</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4078</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>29.689686</td>\n",
       "      <td>29.689192</td>\n",
       "      <td>0.672802</td>\n",
       "      <td>1.596876</td>\n",
       "      <td>0.232609</td>\n",
       "      <td>0.270061</td>\n",
       "      <td>0.270061</td>\n",
       "      <td>0.106660</td>\n",
       "      <td>0.894833</td>\n",
       "      <td>0.394086</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4193</td>\n",
       "      <td>0.001000</td>\n",
       "      <td>24.935195</td>\n",
       "      <td>24.934196</td>\n",
       "      <td>0.574837</td>\n",
       "      <td>1.395189</td>\n",
       "      <td>0.202001</td>\n",
       "      <td>0.242896</td>\n",
       "      <td>0.242896</td>\n",
       "      <td>0.100741</td>\n",
       "      <td>0.707773</td>\n",
       "      <td>0.303516</td>\n",
       "      <td>0.001000</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3923</td>\n",
       "      <td>0.000445</td>\n",
       "      <td>27.056065</td>\n",
       "      <td>27.055620</td>\n",
       "      <td>1.419199</td>\n",
       "      <td>2.855108</td>\n",
       "      <td>0.378584</td>\n",
       "      <td>0.355296</td>\n",
       "      <td>0.355296</td>\n",
       "      <td>0.113871</td>\n",
       "      <td>2.194590</td>\n",
       "      <td>1.040360</td>\n",
       "      <td>0.000445</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3661</td>\n",
       "      <td>0.000500</td>\n",
       "      <td>21.699400</td>\n",
       "      <td>21.698900</td>\n",
       "      <td>0.985137</td>\n",
       "      <td>2.129520</td>\n",
       "      <td>0.279039</td>\n",
       "      <td>0.297420</td>\n",
       "      <td>0.297420</td>\n",
       "      <td>0.112090</td>\n",
       "      <td>1.458128</td>\n",
       "      <td>0.673019</td>\n",
       "      <td>0.000500</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4387</td>\n",
       "      <td>0.000199</td>\n",
       "      <td>24.087623</td>\n",
       "      <td>24.087424</td>\n",
       "      <td>0.749045</td>\n",
       "      <td>1.665271</td>\n",
       "      <td>0.245283</td>\n",
       "      <td>0.274917</td>\n",
       "      <td>0.274917</td>\n",
       "      <td>0.106142</td>\n",
       "      <td>1.064298</td>\n",
       "      <td>0.479078</td>\n",
       "      <td>0.000199</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4498</td>\n",
       "      <td>0.001264</td>\n",
       "      <td>23.344080</td>\n",
       "      <td>23.342816</td>\n",
       "      <td>0.747044</td>\n",
       "      <td>1.607155</td>\n",
       "      <td>0.252234</td>\n",
       "      <td>0.274382</td>\n",
       "      <td>0.274382</td>\n",
       "      <td>0.102722</td>\n",
       "      <td>1.067154</td>\n",
       "      <td>0.482216</td>\n",
       "      <td>0.001264</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3774</td>\n",
       "      <td>0.000255</td>\n",
       "      <td>21.889542</td>\n",
       "      <td>21.889287</td>\n",
       "      <td>1.095822</td>\n",
       "      <td>2.268940</td>\n",
       "      <td>0.337477</td>\n",
       "      <td>0.320959</td>\n",
       "      <td>0.320959</td>\n",
       "      <td>0.100235</td>\n",
       "      <td>1.691559</td>\n",
       "      <td>0.795662</td>\n",
       "      <td>0.000255</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min        max        ptp      mean       std      nmad  \\\n",
       "0     4278  0.002895  25.049901  25.047006  1.970162  1.737800  1.609739   \n",
       "1     3993  0.000556  21.009731  21.009175  1.128771  1.600075  0.702801   \n",
       "2     4455  0.000622  23.069894  23.069272  0.768609  1.435317  0.339856   \n",
       "3     4078  0.000494  29.689686  29.689192  0.672802  1.596876  0.232609   \n",
       "4     4193  0.001000  24.935195  24.934196  0.574837  1.395189  0.202001   \n",
       "..     ...       ...        ...        ...       ...       ...       ...   \n",
       "179   3923  0.000445  27.056065  27.055620  1.419199  2.855108  0.378584   \n",
       "180   3661  0.000500  21.699400  21.698900  0.985137  2.129520  0.279039   \n",
       "181   4387  0.000199  24.087623  24.087424  0.749045  1.665271  0.245283   \n",
       "182   4498  0.001264  23.344080  23.342816  0.747044  1.607155  0.252234   \n",
       "183   3774  0.000255  21.889542  21.889287  1.095822  2.268940  0.337477   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    1.809814  1.809814  0.344090  3.260845  1.458378  0.002895   \n",
       "1    0.628768  0.628768  0.157324  2.022739  0.932707  0.000556   \n",
       "2    0.341667  0.341667  0.114052  1.224514  0.555231  0.000622   \n",
       "3    0.270061  0.270061  0.106660  0.894833  0.394086  0.000494   \n",
       "4    0.242896  0.242896  0.100741  0.707773  0.303516  0.001000   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "179  0.355296  0.355296  0.113871  2.194590  1.040360  0.000445   \n",
       "180  0.297420  0.297420  0.112090  1.458128  0.673019  0.000500   \n",
       "181  0.274917  0.274917  0.106142  1.064298  0.479078  0.000199   \n",
       "182  0.274382  0.274382  0.102722  1.067154  0.482216  0.001264   \n",
       "183  0.320959  0.320959  0.100235  1.691559  0.795662  0.000255   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4214.418478</td>\n",
       "      <td>0.000410</td>\n",
       "      <td>23.451511</td>\n",
       "      <td>23.451101</td>\n",
       "      <td>0.742223</td>\n",
       "      <td>1.571787</td>\n",
       "      <td>0.245052</td>\n",
       "      <td>0.278057</td>\n",
       "      <td>0.278057</td>\n",
       "      <td>0.101500</td>\n",
       "      <td>1.041106</td>\n",
       "      <td>0.469803</td>\n",
       "      <td>0.000410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1016.301424</td>\n",
       "      <td>0.000539</td>\n",
       "      <td>5.146553</td>\n",
       "      <td>5.146431</td>\n",
       "      <td>0.352161</td>\n",
       "      <td>0.632536</td>\n",
       "      <td>0.143528</td>\n",
       "      <td>0.132836</td>\n",
       "      <td>0.132836</td>\n",
       "      <td>0.024810</td>\n",
       "      <td>0.644314</td>\n",
       "      <td>0.313092</td>\n",
       "      <td>0.000539</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>998.000000</td>\n",
       "      <td>0.000003</td>\n",
       "      <td>4.896316</td>\n",
       "      <td>4.895641</td>\n",
       "      <td>0.286018</td>\n",
       "      <td>0.403107</td>\n",
       "      <td>0.121131</td>\n",
       "      <td>0.153009</td>\n",
       "      <td>0.153009</td>\n",
       "      <td>0.063359</td>\n",
       "      <td>0.295889</td>\n",
       "      <td>0.112415</td>\n",
       "      <td>0.000003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3750.000000</td>\n",
       "      <td>0.000113</td>\n",
       "      <td>20.600229</td>\n",
       "      <td>20.599846</td>\n",
       "      <td>0.452445</td>\n",
       "      <td>1.053185</td>\n",
       "      <td>0.147490</td>\n",
       "      <td>0.213958</td>\n",
       "      <td>0.213958</td>\n",
       "      <td>0.086136</td>\n",
       "      <td>0.524816</td>\n",
       "      <td>0.218476</td>\n",
       "      <td>0.000113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4202.500000</td>\n",
       "      <td>0.000240</td>\n",
       "      <td>23.475487</td>\n",
       "      <td>23.475386</td>\n",
       "      <td>0.663254</td>\n",
       "      <td>1.513351</td>\n",
       "      <td>0.222941</td>\n",
       "      <td>0.261181</td>\n",
       "      <td>0.261181</td>\n",
       "      <td>0.098160</td>\n",
       "      <td>0.872775</td>\n",
       "      <td>0.386793</td>\n",
       "      <td>0.000240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4641.750000</td>\n",
       "      <td>0.000515</td>\n",
       "      <td>26.939119</td>\n",
       "      <td>26.938572</td>\n",
       "      <td>0.974382</td>\n",
       "      <td>2.059905</td>\n",
       "      <td>0.297373</td>\n",
       "      <td>0.314129</td>\n",
       "      <td>0.314129</td>\n",
       "      <td>0.113677</td>\n",
       "      <td>1.406553</td>\n",
       "      <td>0.649468</td>\n",
       "      <td>0.000515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7426.000000</td>\n",
       "      <td>0.004525</td>\n",
       "      <td>38.215685</td>\n",
       "      <td>38.214064</td>\n",
       "      <td>1.970162</td>\n",
       "      <td>3.365714</td>\n",
       "      <td>1.609739</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>0.344090</td>\n",
       "      <td>3.520276</td>\n",
       "      <td>1.689305</td>\n",
       "      <td>0.004525</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min         max         ptp        mean  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean   4214.418478    0.000410   23.451511   23.451101    0.742223   \n",
       "std    1016.301424    0.000539    5.146553    5.146431    0.352161   \n",
       "min     998.000000    0.000003    4.896316    4.895641    0.286018   \n",
       "25%    3750.000000    0.000113   20.600229   20.599846    0.452445   \n",
       "50%    4202.500000    0.000240   23.475487   23.475386    0.663254   \n",
       "75%    4641.750000    0.000515   26.939119   26.938572    0.974382   \n",
       "max    7426.000000    0.004525   38.215685   38.214064    1.970162   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     1.571787    0.245052    0.278057    0.278057    0.101500    1.041106   \n",
       "std      0.632536    0.143528    0.132836    0.132836    0.024810    0.644314   \n",
       "min      0.403107    0.121131    0.153009    0.153009    0.063359    0.295889   \n",
       "25%      1.053185    0.147490    0.213958    0.213958    0.086136    0.524816   \n",
       "50%      1.513351    0.222941    0.261181    0.261181    0.098160    0.872775   \n",
       "75%      2.059905    0.297373    0.314129    0.314129    0.113677    1.406553   \n",
       "max      3.365714    1.609739    1.809814    1.809814    0.344090    3.520276   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     0.469803    0.000410  \n",
       "std      0.313092    0.000539  \n",
       "min      0.112415    0.000003  \n",
       "25%      0.218476    0.000113  \n",
       "50%      0.386793    0.000240  \n",
       "75%      0.649468    0.000515  \n",
       "max      1.689305    0.004525  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4278</td>\n",
       "      <td>0.002895</td>\n",
       "      <td>25.049901</td>\n",
       "      <td>25.047006</td>\n",
       "      <td>1.970162</td>\n",
       "      <td>1.7378</td>\n",
       "      <td>1.609739</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>1.809814</td>\n",
       "      <td>0.34409</td>\n",
       "      <td>3.260845</td>\n",
       "      <td>1.458378</td>\n",
       "      <td>0.002895</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   count       min        max        ptp      mean     std      nmad  \\\n",
       "0   4278  0.002895  25.049901  25.047006  1.970162  1.7378  1.609739   \n",
       "\n",
       "        med    median      p16       p84    spread      mode  \\\n",
       "0  1.809814  1.809814  0.34409  3.260845  1.458378  0.002895   \n",
       "\n",
       "                                              camera  \n",
       "0  20190827_214711_ssc9d1_0001_basic_panchromatic...  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error[final_error['median']>1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "After adjustment, all frame camera models have median reprojection errors less than 1 px, with 75% of them having median reprojection error less than 0.3 px. The first camera is shown to still have median reprojection higher than 1, that is because the first 3 cameras and the corresponding pairs from the nadir view (in total six) were kept fixed in the first bundle adjust invocation being tested in this case."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 61,  50,  42,  52,  53,  89,  46, 165,  88, 113,  63,  60,  61,\n",
       "        90,  77,  25,  36,  36,  27, 133, 115,  48,  34,  93,  88,  51,\n",
       "        49, 144,  49,  49,  93,  51, 120,  34, 102,  71,  69,  62,  44,\n",
       "        29,  11,  60,  96, 161,  48,  64,  29,  99,  55,  74,  44,  48,\n",
       "        47,  79,  48,  44,  49,  34,  48,  59,  48,  55,  86,  50, 126,\n",
       "       112,  60,  67,  70,  68,  22,  44,  79,  80,  41,  24,  38,  25,\n",
       "        23,  75, 108,  44,  37,  24,  76,  79,  46,  30,  38,  81,  71,\n",
       "        43,  31,  73,  47,  85,  62,  32,  57,  63,  62,  29,  61,  12,\n",
       "        38,  40,  25,  22,  46,  66, 109,  56,  43,  72,  23,  69,  33,\n",
       "        54,  74,  44,  66,  67,  31,  61,  48,  50,  27,  57,  45,  53,\n",
       "        58,  88, 100,  97, 156,  91,  83,  78,  44,  48,  68,  76,  33,\n",
       "        30,  38,   8,  15,  92, 100,  46,  37,  79,  84,  53,  84, 109,\n",
       "        98,  57,  70,  58,  95,  58,  60,  90,  54,  79,  18,  46,  35,\n",
       "        55,  67, 139,  61,  78,  22,  72,  43,  51,  65,  66,  46,  58,\n",
       "        61,  64])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error['count'].values - final_error['count'].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Case 2: Bundle adjustment using camera obtained from 1 m DEM\n",
    "\n",
    "in this case, some initial cameras were really bad as the cam_gen algorithm had a hard time projecting rays from the camera onto the DEM to produce GCPs which are required in camera resection. During bundle adjustment, no robust threshold, no camera weight, no parameter tolerance were used (no here corresponds to ASP defaults).\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a2788073c2684aa8b8817f55d4059975",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "init_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_no_robust_threahold_cam_wt0_old_cam_1m_dem/run-initial_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>297.894836</td>\n",
       "      <td>297.892436</td>\n",
       "      <td>7.128450</td>\n",
       "      <td>18.727233</td>\n",
       "      <td>1.332530</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>1.147045</td>\n",
       "      <td>5.751471</td>\n",
       "      <td>2.302213</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>816.365335</td>\n",
       "      <td>816.363323</td>\n",
       "      <td>18.999679</td>\n",
       "      <td>65.469710</td>\n",
       "      <td>1.327944</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>0.872419</td>\n",
       "      <td>8.942207</td>\n",
       "      <td>4.034894</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>604.868628</td>\n",
       "      <td>604.868189</td>\n",
       "      <td>13.717504</td>\n",
       "      <td>43.768236</td>\n",
       "      <td>1.767357</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>0.738754</td>\n",
       "      <td>6.835124</td>\n",
       "      <td>3.048185</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>1089.183071</td>\n",
       "      <td>1089.181493</td>\n",
       "      <td>10.923567</td>\n",
       "      <td>39.314013</td>\n",
       "      <td>1.742044</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>0.899072</td>\n",
       "      <td>8.591055</td>\n",
       "      <td>3.845992</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>690.862942</td>\n",
       "      <td>690.861705</td>\n",
       "      <td>10.253059</td>\n",
       "      <td>28.755326</td>\n",
       "      <td>1.615218</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>1.179674</td>\n",
       "      <td>6.251278</td>\n",
       "      <td>2.535802</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>208.515243</td>\n",
       "      <td>208.505275</td>\n",
       "      <td>5.065009</td>\n",
       "      <td>8.908716</td>\n",
       "      <td>2.742966</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>1.788185</td>\n",
       "      <td>7.408262</td>\n",
       "      <td>2.810039</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>112.419911</td>\n",
       "      <td>112.417582</td>\n",
       "      <td>3.874235</td>\n",
       "      <td>5.474216</td>\n",
       "      <td>1.541600</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>1.639157</td>\n",
       "      <td>4.743060</td>\n",
       "      <td>1.551951</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>254.660063</td>\n",
       "      <td>254.657570</td>\n",
       "      <td>3.913260</td>\n",
       "      <td>10.800301</td>\n",
       "      <td>1.475802</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>1.120850</td>\n",
       "      <td>3.960554</td>\n",
       "      <td>1.419852</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>867.867329</td>\n",
       "      <td>867.860438</td>\n",
       "      <td>4.021469</td>\n",
       "      <td>21.440359</td>\n",
       "      <td>1.054237</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>1.180014</td>\n",
       "      <td>3.908172</td>\n",
       "      <td>1.364079</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>140.034425</td>\n",
       "      <td>140.033138</td>\n",
       "      <td>3.159021</td>\n",
       "      <td>4.506689</td>\n",
       "      <td>1.396247</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>1.217681</td>\n",
       "      <td>4.661731</td>\n",
       "      <td>1.722025</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.002401   297.894836   297.892436   7.128450  18.727233   \n",
       "1     4043  0.002011   816.365335   816.363323  18.999679  65.469710   \n",
       "2     4497  0.000439   604.868628   604.868189  13.717504  43.768236   \n",
       "3     4130  0.001577  1089.183071  1089.181493  10.923567  39.314013   \n",
       "4     4246  0.001237   690.862942   690.861705  10.253059  28.755326   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.009968   208.515243   208.505275   5.065009   8.908716   \n",
       "180   3707  0.002329   112.419911   112.417582   3.874235   5.474216   \n",
       "181   4445  0.002493   254.660063   254.657570   3.913260  10.800301   \n",
       "182   4559  0.006891   867.867329   867.860438   4.021469  21.440359   \n",
       "183   3838  0.001287   140.034425   140.033138   3.159021   4.506689   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332530  2.177517  2.177517  1.147045  5.751471  2.302213  0.002401   \n",
       "1    1.327944  1.940239  1.940239  0.872419  8.942207  4.034894  0.002011   \n",
       "2    1.767357  2.168104  2.168104  0.738754  6.835124  3.048185  0.000439   \n",
       "3    1.742044  2.237118  2.237118  0.899072  8.591055  3.845992  0.001577   \n",
       "4    1.615218  2.711200  2.711200  1.179674  6.251278  2.535802  0.001237   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.742966  3.781187  3.781187  1.788185  7.408262  2.810039  0.009968   \n",
       "180  1.541600  3.009121  3.009121  1.639157  4.743060  1.551951  0.002329   \n",
       "181  1.475802  2.519583  2.519583  1.120850  3.960554  1.419852  0.002493   \n",
       "182  1.054237  2.198737  2.198737  1.180014  3.908172  1.364079  0.006891   \n",
       "183  1.396247  2.394188  2.394188  1.217681  4.661731  1.722025  0.001287   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.007306</td>\n",
       "      <td>1474.830574</td>\n",
       "      <td>1474.823268</td>\n",
       "      <td>13.833578</td>\n",
       "      <td>51.261317</td>\n",
       "      <td>3.063889</td>\n",
       "      <td>3.952603</td>\n",
       "      <td>3.952603</td>\n",
       "      <td>1.509026</td>\n",
       "      <td>12.921044</td>\n",
       "      <td>5.706009</td>\n",
       "      <td>0.007306</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.023472</td>\n",
       "      <td>3913.831991</td>\n",
       "      <td>3913.830991</td>\n",
       "      <td>18.005092</td>\n",
       "      <td>84.657266</td>\n",
       "      <td>12.181799</td>\n",
       "      <td>12.803563</td>\n",
       "      <td>12.803563</td>\n",
       "      <td>3.381976</td>\n",
       "      <td>30.301611</td>\n",
       "      <td>13.667355</td>\n",
       "      <td>0.023472</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000029</td>\n",
       "      <td>17.212054</td>\n",
       "      <td>17.210855</td>\n",
       "      <td>1.495567</td>\n",
       "      <td>1.502241</td>\n",
       "      <td>0.434431</td>\n",
       "      <td>0.418657</td>\n",
       "      <td>0.418657</td>\n",
       "      <td>0.111299</td>\n",
       "      <td>1.427474</td>\n",
       "      <td>0.658087</td>\n",
       "      <td>0.000029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000587</td>\n",
       "      <td>278.408534</td>\n",
       "      <td>278.408060</td>\n",
       "      <td>5.322401</td>\n",
       "      <td>15.064658</td>\n",
       "      <td>1.233124</td>\n",
       "      <td>1.730390</td>\n",
       "      <td>1.730390</td>\n",
       "      <td>0.613695</td>\n",
       "      <td>3.932978</td>\n",
       "      <td>1.567425</td>\n",
       "      <td>0.000587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.001755</td>\n",
       "      <td>571.373956</td>\n",
       "      <td>571.371685</td>\n",
       "      <td>9.705959</td>\n",
       "      <td>29.501283</td>\n",
       "      <td>1.716924</td>\n",
       "      <td>2.462270</td>\n",
       "      <td>2.462270</td>\n",
       "      <td>0.996144</td>\n",
       "      <td>6.185707</td>\n",
       "      <td>2.412672</td>\n",
       "      <td>0.001755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.004803</td>\n",
       "      <td>1077.851569</td>\n",
       "      <td>1077.850197</td>\n",
       "      <td>16.156704</td>\n",
       "      <td>57.198345</td>\n",
       "      <td>2.484913</td>\n",
       "      <td>3.570954</td>\n",
       "      <td>3.570954</td>\n",
       "      <td>1.526624</td>\n",
       "      <td>9.554061</td>\n",
       "      <td>4.043003</td>\n",
       "      <td>0.004803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.258760</td>\n",
       "      <td>34388.052316</td>\n",
       "      <td>34388.049567</td>\n",
       "      <td>210.393766</td>\n",
       "      <td>827.451580</td>\n",
       "      <td>163.045469</td>\n",
       "      <td>170.540901</td>\n",
       "      <td>170.540901</td>\n",
       "      <td>43.855534</td>\n",
       "      <td>376.294759</td>\n",
       "      <td>166.219613</td>\n",
       "      <td>0.258760</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min           max           ptp        mean  \\\n",
       "count   184.000000  184.000000    184.000000    184.000000  184.000000   \n",
       "mean   4275.956522    0.007306   1474.830574   1474.823268   13.833578   \n",
       "std    1022.520436    0.023472   3913.831991   3913.830991   18.005092   \n",
       "min    1013.000000    0.000029     17.212054     17.210855    1.495567   \n",
       "25%    3804.000000    0.000587    278.408534    278.408060    5.322401   \n",
       "50%    4266.000000    0.001755    571.373956    571.371685    9.705959   \n",
       "75%    4703.500000    0.004803   1077.851569   1077.850197   16.156704   \n",
       "max    7479.000000    0.258760  34388.052316  34388.049567  210.393766   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean    51.261317    3.063889    3.952603    3.952603    1.509026   12.921044   \n",
       "std     84.657266   12.181799   12.803563   12.803563    3.381976   30.301611   \n",
       "min      1.502241    0.434431    0.418657    0.418657    0.111299    1.427474   \n",
       "25%     15.064658    1.233124    1.730390    1.730390    0.613695    3.932978   \n",
       "50%     29.501283    1.716924    2.462270    2.462270    0.996144    6.185707   \n",
       "75%     57.198345    2.484913    3.570954    3.570954    1.526624    9.554061   \n",
       "max    827.451580  163.045469  170.540901  170.540901   43.855534  376.294759   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     5.706009    0.007306  \n",
       "std     13.667355    0.023472  \n",
       "min      0.658087    0.000029  \n",
       "25%      1.567425    0.000587  \n",
       "50%      2.412672    0.001755  \n",
       "75%      4.043003    0.004803  \n",
       "max    166.219613    0.258760  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>297.894836</td>\n",
       "      <td>297.892436</td>\n",
       "      <td>7.128450</td>\n",
       "      <td>18.727233</td>\n",
       "      <td>1.332530</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>1.147045</td>\n",
       "      <td>5.751471</td>\n",
       "      <td>2.302213</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>816.365335</td>\n",
       "      <td>816.363323</td>\n",
       "      <td>18.999679</td>\n",
       "      <td>65.469710</td>\n",
       "      <td>1.327944</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>0.872419</td>\n",
       "      <td>8.942207</td>\n",
       "      <td>4.034894</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>604.868628</td>\n",
       "      <td>604.868189</td>\n",
       "      <td>13.717504</td>\n",
       "      <td>43.768236</td>\n",
       "      <td>1.767357</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>0.738754</td>\n",
       "      <td>6.835124</td>\n",
       "      <td>3.048185</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>1089.183071</td>\n",
       "      <td>1089.181493</td>\n",
       "      <td>10.923567</td>\n",
       "      <td>39.314013</td>\n",
       "      <td>1.742044</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>0.899072</td>\n",
       "      <td>8.591055</td>\n",
       "      <td>3.845992</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>690.862942</td>\n",
       "      <td>690.861705</td>\n",
       "      <td>10.253059</td>\n",
       "      <td>28.755326</td>\n",
       "      <td>1.615218</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>1.179674</td>\n",
       "      <td>6.251278</td>\n",
       "      <td>2.535802</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>208.515243</td>\n",
       "      <td>208.505275</td>\n",
       "      <td>5.065009</td>\n",
       "      <td>8.908716</td>\n",
       "      <td>2.742966</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>1.788185</td>\n",
       "      <td>7.408262</td>\n",
       "      <td>2.810039</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>112.419911</td>\n",
       "      <td>112.417582</td>\n",
       "      <td>3.874235</td>\n",
       "      <td>5.474216</td>\n",
       "      <td>1.541600</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>1.639157</td>\n",
       "      <td>4.743060</td>\n",
       "      <td>1.551951</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>254.660063</td>\n",
       "      <td>254.657570</td>\n",
       "      <td>3.913260</td>\n",
       "      <td>10.800301</td>\n",
       "      <td>1.475802</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>1.120850</td>\n",
       "      <td>3.960554</td>\n",
       "      <td>1.419852</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>867.867329</td>\n",
       "      <td>867.860438</td>\n",
       "      <td>4.021469</td>\n",
       "      <td>21.440359</td>\n",
       "      <td>1.054237</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>1.180014</td>\n",
       "      <td>3.908172</td>\n",
       "      <td>1.364079</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>140.034425</td>\n",
       "      <td>140.033138</td>\n",
       "      <td>3.159021</td>\n",
       "      <td>4.506689</td>\n",
       "      <td>1.396247</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>1.217681</td>\n",
       "      <td>4.661731</td>\n",
       "      <td>1.722025</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>168 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.002401   297.894836   297.892436   7.128450  18.727233   \n",
       "1     4043  0.002011   816.365335   816.363323  18.999679  65.469710   \n",
       "2     4497  0.000439   604.868628   604.868189  13.717504  43.768236   \n",
       "3     4130  0.001577  1089.183071  1089.181493  10.923567  39.314013   \n",
       "4     4246  0.001237   690.862942   690.861705  10.253059  28.755326   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.009968   208.515243   208.505275   5.065009   8.908716   \n",
       "180   3707  0.002329   112.419911   112.417582   3.874235   5.474216   \n",
       "181   4445  0.002493   254.660063   254.657570   3.913260  10.800301   \n",
       "182   4559  0.006891   867.867329   867.860438   4.021469  21.440359   \n",
       "183   3838  0.001287   140.034425   140.033138   3.159021   4.506689   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332530  2.177517  2.177517  1.147045  5.751471  2.302213  0.002401   \n",
       "1    1.327944  1.940239  1.940239  0.872419  8.942207  4.034894  0.002011   \n",
       "2    1.767357  2.168104  2.168104  0.738754  6.835124  3.048185  0.000439   \n",
       "3    1.742044  2.237118  2.237118  0.899072  8.591055  3.845992  0.001577   \n",
       "4    1.615218  2.711200  2.711200  1.179674  6.251278  2.535802  0.001237   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.742966  3.781187  3.781187  1.788185  7.408262  2.810039  0.009968   \n",
       "180  1.541600  3.009121  3.009121  1.639157  4.743060  1.551951  0.002329   \n",
       "181  1.475802  2.519583  2.519583  1.120850  3.960554  1.419852  0.002493   \n",
       "182  1.054237  2.198737  2.198737  1.180014  3.908172  1.364079  0.006891   \n",
       "183  1.396247  2.394188  2.394188  1.217681  4.661731  1.722025  0.001287   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[168 rows x 14 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error[init_error['median']>1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0d76a6dac6fa4b6fae19b6fcb31e0cd5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "final_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_no_robust_threahold_cam_wt0_old_cam_1m_dem/run-final_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4278</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>25.040416</td>\n",
       "      <td>25.037707</td>\n",
       "      <td>1.994100</td>\n",
       "      <td>1.756651</td>\n",
       "      <td>1.617901</td>\n",
       "      <td>1.834810</td>\n",
       "      <td>1.834810</td>\n",
       "      <td>0.351344</td>\n",
       "      <td>3.291193</td>\n",
       "      <td>1.469925</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3993</td>\n",
       "      <td>0.002263</td>\n",
       "      <td>20.988367</td>\n",
       "      <td>20.986103</td>\n",
       "      <td>1.132247</td>\n",
       "      <td>1.601598</td>\n",
       "      <td>0.705524</td>\n",
       "      <td>0.631527</td>\n",
       "      <td>0.631527</td>\n",
       "      <td>0.157697</td>\n",
       "      <td>2.032688</td>\n",
       "      <td>0.937495</td>\n",
       "      <td>0.002263</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4455</td>\n",
       "      <td>0.000276</td>\n",
       "      <td>23.076382</td>\n",
       "      <td>23.076106</td>\n",
       "      <td>0.768531</td>\n",
       "      <td>1.435615</td>\n",
       "      <td>0.341278</td>\n",
       "      <td>0.341852</td>\n",
       "      <td>0.341852</td>\n",
       "      <td>0.112673</td>\n",
       "      <td>1.212766</td>\n",
       "      <td>0.550047</td>\n",
       "      <td>0.000276</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4078</td>\n",
       "      <td>0.000272</td>\n",
       "      <td>29.684492</td>\n",
       "      <td>29.684219</td>\n",
       "      <td>0.672536</td>\n",
       "      <td>1.593852</td>\n",
       "      <td>0.234048</td>\n",
       "      <td>0.270638</td>\n",
       "      <td>0.270638</td>\n",
       "      <td>0.106865</td>\n",
       "      <td>0.895767</td>\n",
       "      <td>0.394451</td>\n",
       "      <td>0.000272</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4193</td>\n",
       "      <td>0.001765</td>\n",
       "      <td>24.936099</td>\n",
       "      <td>24.934334</td>\n",
       "      <td>0.571522</td>\n",
       "      <td>1.383888</td>\n",
       "      <td>0.201256</td>\n",
       "      <td>0.242414</td>\n",
       "      <td>0.242414</td>\n",
       "      <td>0.100484</td>\n",
       "      <td>0.710707</td>\n",
       "      <td>0.305112</td>\n",
       "      <td>0.001765</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3923</td>\n",
       "      <td>0.000332</td>\n",
       "      <td>27.056905</td>\n",
       "      <td>27.056572</td>\n",
       "      <td>1.310871</td>\n",
       "      <td>2.676186</td>\n",
       "      <td>0.369644</td>\n",
       "      <td>0.347697</td>\n",
       "      <td>0.347697</td>\n",
       "      <td>0.112051</td>\n",
       "      <td>1.967517</td>\n",
       "      <td>0.927733</td>\n",
       "      <td>0.000332</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3661</td>\n",
       "      <td>0.000383</td>\n",
       "      <td>21.741438</td>\n",
       "      <td>21.741055</td>\n",
       "      <td>0.997118</td>\n",
       "      <td>2.157867</td>\n",
       "      <td>0.283495</td>\n",
       "      <td>0.299341</td>\n",
       "      <td>0.299341</td>\n",
       "      <td>0.111810</td>\n",
       "      <td>1.477134</td>\n",
       "      <td>0.682662</td>\n",
       "      <td>0.000383</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4385</td>\n",
       "      <td>0.000223</td>\n",
       "      <td>22.075917</td>\n",
       "      <td>22.075693</td>\n",
       "      <td>0.744964</td>\n",
       "      <td>1.592159</td>\n",
       "      <td>0.250080</td>\n",
       "      <td>0.277929</td>\n",
       "      <td>0.277929</td>\n",
       "      <td>0.105894</td>\n",
       "      <td>1.092861</td>\n",
       "      <td>0.493483</td>\n",
       "      <td>0.000223</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4498</td>\n",
       "      <td>0.000140</td>\n",
       "      <td>23.341143</td>\n",
       "      <td>23.341003</td>\n",
       "      <td>0.747977</td>\n",
       "      <td>1.597595</td>\n",
       "      <td>0.254769</td>\n",
       "      <td>0.276604</td>\n",
       "      <td>0.276604</td>\n",
       "      <td>0.102642</td>\n",
       "      <td>1.083545</td>\n",
       "      <td>0.490451</td>\n",
       "      <td>0.000140</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3774</td>\n",
       "      <td>0.000213</td>\n",
       "      <td>21.898844</td>\n",
       "      <td>21.898631</td>\n",
       "      <td>1.004416</td>\n",
       "      <td>2.135903</td>\n",
       "      <td>0.318754</td>\n",
       "      <td>0.308893</td>\n",
       "      <td>0.308893</td>\n",
       "      <td>0.098494</td>\n",
       "      <td>1.519382</td>\n",
       "      <td>0.710444</td>\n",
       "      <td>0.000213</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min        max        ptp      mean       std      nmad  \\\n",
       "0     4278  0.002710  25.040416  25.037707  1.994100  1.756651  1.617901   \n",
       "1     3993  0.002263  20.988367  20.986103  1.132247  1.601598  0.705524   \n",
       "2     4455  0.000276  23.076382  23.076106  0.768531  1.435615  0.341278   \n",
       "3     4078  0.000272  29.684492  29.684219  0.672536  1.593852  0.234048   \n",
       "4     4193  0.001765  24.936099  24.934334  0.571522  1.383888  0.201256   \n",
       "..     ...       ...        ...        ...       ...       ...       ...   \n",
       "179   3923  0.000332  27.056905  27.056572  1.310871  2.676186  0.369644   \n",
       "180   3661  0.000383  21.741438  21.741055  0.997118  2.157867  0.283495   \n",
       "181   4385  0.000223  22.075917  22.075693  0.744964  1.592159  0.250080   \n",
       "182   4498  0.000140  23.341143  23.341003  0.747977  1.597595  0.254769   \n",
       "183   3774  0.000213  21.898844  21.898631  1.004416  2.135903  0.318754   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    1.834810  1.834810  0.351344  3.291193  1.469925  0.002710   \n",
       "1    0.631527  0.631527  0.157697  2.032688  0.937495  0.002263   \n",
       "2    0.341852  0.341852  0.112673  1.212766  0.550047  0.000276   \n",
       "3    0.270638  0.270638  0.106865  0.895767  0.394451  0.000272   \n",
       "4    0.242414  0.242414  0.100484  0.710707  0.305112  0.001765   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "179  0.347697  0.347697  0.112051  1.967517  0.927733  0.000332   \n",
       "180  0.299341  0.299341  0.111810  1.477134  0.682662  0.000383   \n",
       "181  0.277929  0.277929  0.105894  1.092861  0.493483  0.000223   \n",
       "182  0.276604  0.276604  0.102642  1.083545  0.490451  0.000140   \n",
       "183  0.308893  0.308893  0.098494  1.519382  0.710444  0.000213   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4176.489130</td>\n",
       "      <td>0.000604</td>\n",
       "      <td>23.321321</td>\n",
       "      <td>23.320716</td>\n",
       "      <td>0.790333</td>\n",
       "      <td>1.590231</td>\n",
       "      <td>0.287020</td>\n",
       "      <td>0.326412</td>\n",
       "      <td>0.326412</td>\n",
       "      <td>0.113887</td>\n",
       "      <td>1.127859</td>\n",
       "      <td>0.506986</td>\n",
       "      <td>0.000604</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1049.850231</td>\n",
       "      <td>0.002413</td>\n",
       "      <td>5.521353</td>\n",
       "      <td>5.520485</td>\n",
       "      <td>0.809522</td>\n",
       "      <td>0.795359</td>\n",
       "      <td>0.598430</td>\n",
       "      <td>0.680318</td>\n",
       "      <td>0.680318</td>\n",
       "      <td>0.174836</td>\n",
       "      <td>1.409189</td>\n",
       "      <td>0.624349</td>\n",
       "      <td>0.002413</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>517.000000</td>\n",
       "      <td>0.000017</td>\n",
       "      <td>3.999460</td>\n",
       "      <td>3.999146</td>\n",
       "      <td>0.233404</td>\n",
       "      <td>0.258592</td>\n",
       "      <td>0.121010</td>\n",
       "      <td>0.152472</td>\n",
       "      <td>0.152472</td>\n",
       "      <td>0.062746</td>\n",
       "      <td>0.296579</td>\n",
       "      <td>0.112188</td>\n",
       "      <td>0.000017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3680.750000</td>\n",
       "      <td>0.000127</td>\n",
       "      <td>20.257983</td>\n",
       "      <td>20.257509</td>\n",
       "      <td>0.444968</td>\n",
       "      <td>1.057742</td>\n",
       "      <td>0.147851</td>\n",
       "      <td>0.213780</td>\n",
       "      <td>0.213780</td>\n",
       "      <td>0.085861</td>\n",
       "      <td>0.522691</td>\n",
       "      <td>0.217362</td>\n",
       "      <td>0.000127</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4192.000000</td>\n",
       "      <td>0.000271</td>\n",
       "      <td>23.237954</td>\n",
       "      <td>23.236601</td>\n",
       "      <td>0.651620</td>\n",
       "      <td>1.484989</td>\n",
       "      <td>0.225159</td>\n",
       "      <td>0.262193</td>\n",
       "      <td>0.262193</td>\n",
       "      <td>0.098914</td>\n",
       "      <td>0.869557</td>\n",
       "      <td>0.385525</td>\n",
       "      <td>0.000271</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4624.000000</td>\n",
       "      <td>0.000441</td>\n",
       "      <td>26.364316</td>\n",
       "      <td>26.363591</td>\n",
       "      <td>0.973839</td>\n",
       "      <td>2.081056</td>\n",
       "      <td>0.294685</td>\n",
       "      <td>0.311858</td>\n",
       "      <td>0.311858</td>\n",
       "      <td>0.113190</td>\n",
       "      <td>1.396525</td>\n",
       "      <td>0.644725</td>\n",
       "      <td>0.000441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7400.000000</td>\n",
       "      <td>0.032342</td>\n",
       "      <td>50.101988</td>\n",
       "      <td>50.069645</td>\n",
       "      <td>10.619888</td>\n",
       "      <td>8.053426</td>\n",
       "      <td>8.123048</td>\n",
       "      <td>9.323229</td>\n",
       "      <td>9.323229</td>\n",
       "      <td>2.447980</td>\n",
       "      <td>18.017812</td>\n",
       "      <td>7.784916</td>\n",
       "      <td>0.032342</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min         max         ptp        mean  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean   4176.489130    0.000604   23.321321   23.320716    0.790333   \n",
       "std    1049.850231    0.002413    5.521353    5.520485    0.809522   \n",
       "min     517.000000    0.000017    3.999460    3.999146    0.233404   \n",
       "25%    3680.750000    0.000127   20.257983   20.257509    0.444968   \n",
       "50%    4192.000000    0.000271   23.237954   23.236601    0.651620   \n",
       "75%    4624.000000    0.000441   26.364316   26.363591    0.973839   \n",
       "max    7400.000000    0.032342   50.101988   50.069645   10.619888   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     1.590231    0.287020    0.326412    0.326412    0.113887    1.127859   \n",
       "std      0.795359    0.598430    0.680318    0.680318    0.174836    1.409189   \n",
       "min      0.258592    0.121010    0.152472    0.152472    0.062746    0.296579   \n",
       "25%      1.057742    0.147851    0.213780    0.213780    0.085861    0.522691   \n",
       "50%      1.484989    0.225159    0.262193    0.262193    0.098914    0.869557   \n",
       "75%      2.081056    0.294685    0.311858    0.311858    0.113190    1.396525   \n",
       "max      8.053426    8.123048    9.323229    9.323229    2.447980   18.017812   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     0.506986    0.000604  \n",
       "std      0.624349    0.002413  \n",
       "min      0.112188    0.000017  \n",
       "25%      0.217362    0.000127  \n",
       "50%      0.385525    0.000271  \n",
       "75%      0.644725    0.000441  \n",
       "max      7.784916    0.032342  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4278</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>25.040416</td>\n",
       "      <td>25.037707</td>\n",
       "      <td>1.994100</td>\n",
       "      <td>1.756651</td>\n",
       "      <td>1.617901</td>\n",
       "      <td>1.834810</td>\n",
       "      <td>1.834810</td>\n",
       "      <td>0.351344</td>\n",
       "      <td>3.291193</td>\n",
       "      <td>1.469925</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>517</td>\n",
       "      <td>0.032342</td>\n",
       "      <td>50.101988</td>\n",
       "      <td>50.069645</td>\n",
       "      <td>10.619888</td>\n",
       "      <td>8.053426</td>\n",
       "      <td>8.123048</td>\n",
       "      <td>9.323229</td>\n",
       "      <td>9.323229</td>\n",
       "      <td>2.447980</td>\n",
       "      <td>18.017812</td>\n",
       "      <td>7.784916</td>\n",
       "      <td>0.032342</td>\n",
       "      <td>20190827_214711_ssc9d3_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    count       min        max        ptp       mean       std      nmad  \\\n",
       "0    4278  0.002710  25.040416  25.037707   1.994100  1.756651  1.617901   \n",
       "42    517  0.032342  50.101988  50.069645  10.619888  8.053426  8.123048   \n",
       "\n",
       "         med    median       p16        p84    spread      mode  \\\n",
       "0   1.834810  1.834810  0.351344   3.291193  1.469925  0.002710   \n",
       "42  9.323229  9.323229  2.447980  18.017812  7.784916  0.032342   \n",
       "\n",
       "                                               camera  \n",
       "0   20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "42  20190827_214711_ssc9d3_0005_basic_panchromatic...  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error[final_error['median'] > 1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count                                                  2919\n",
       "min                                                 0.25876\n",
       "max                                                 1011.37\n",
       "ptp                                                 1011.11\n",
       "mean                                                210.394\n",
       "std                                                 172.025\n",
       "nmad                                                163.045\n",
       "med                                                 170.541\n",
       "median                                              170.541\n",
       "p16                                                 43.8555\n",
       "p84                                                 376.295\n",
       "spread                                               166.22\n",
       "mode                                                0.25876\n",
       "camera    20190827_214711_ssc9d3_0005_basic_panchromatic...\n",
       "Name: 42, dtype: object"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.iloc[42]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This particular camera was particularly off even when it was initialised, with median reprojection error of 170 px. The program was not able to correct the errors of this particular camera very much, and most of the points were removed as outliers in the first pass (#initial imaged points = 2919, #final image points = 517). We check if robust threshold makes a difference here."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  61,   50,   42,   52,   53,   89,   46,  165,   88,  113,   64,\n",
       "         61,   63,   89,   77,   24,   36,   34,   27,  133,  116,   47,\n",
       "         36,   92,   90,   97,  169,  142,   49,   49,   92,   51,  119,\n",
       "         34,  103,   72,   70,   62,   46,   30,   11,  209, 2402,  193,\n",
       "         47,   64,   27,  100,   55,   74,   45,   47,   48,   80,   48,\n",
       "         44,   49,   34,   48,   59,   48,   55,   85,   50,  126,  112,\n",
       "         60,   67,   69,   70,   22,   46,   78,   80,   41,   23,   38,\n",
       "         24,   22,   75,  108,   43,   37,   23,   78,   79,   49,   36,\n",
       "         42,   81,   70,   43,   31,   73,   47,   84,   61,   32,   58,\n",
       "         64,   63,   29,   60,   12,   40,   44,   26,   23,   59, 1000,\n",
       "       1184,   77,   43,   73,   23,   66,   35,   54,   74,   44,   67,\n",
       "         66,   32,   63,   48,   50,   27,   57,   45,   53,   58,   88,\n",
       "        100,   97,  156,   91,   81,   78,   45,   50,   67,   76,   33,\n",
       "         30,   37,    7,   15,   91,   99,   45,   36,   81,   84,   79,\n",
       "        197,  108,   99,   58,   69,   58,   93,   58,   59,   91,   54,\n",
       "         78,   18,   50,   36,   55, 1114, 1209,   62,   79,   21,   72,\n",
       "         43,   51,   65,   66,   46,   60,   61,   64])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error['count'].values - final_error['count'].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Some of the cameras were raided badly for points and they were just eliminated as outliers. This is in an indicator that the resultant camera are poorly placed."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Case 3: Bundle adjustment using camera obtained from 1 m DEM with high robust_threshold (10) and parameter_tolerance (1e-14)\n",
    "\n",
    "in this case, some initial cameras were really bad as the cam_gen algorithm had a hard time projecting rays from the camera onto the DEM to produce GCPs which are required in camera resection. During bundle adjustment, robust threshold = 10, 0 camera weight, parameter tolerance = 1e-14 were used.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9f41a959a28941bcb4ab4c0b17b36cd0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "init_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_cam_wt0_old_cam_1m_dem/run-initial_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>297.894836</td>\n",
       "      <td>297.892436</td>\n",
       "      <td>7.128450</td>\n",
       "      <td>18.727233</td>\n",
       "      <td>1.332530</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>2.177517</td>\n",
       "      <td>1.147045</td>\n",
       "      <td>5.751471</td>\n",
       "      <td>2.302213</td>\n",
       "      <td>0.002401</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>816.365335</td>\n",
       "      <td>816.363323</td>\n",
       "      <td>18.999679</td>\n",
       "      <td>65.469710</td>\n",
       "      <td>1.327944</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>1.940239</td>\n",
       "      <td>0.872419</td>\n",
       "      <td>8.942207</td>\n",
       "      <td>4.034894</td>\n",
       "      <td>0.002011</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>604.868628</td>\n",
       "      <td>604.868189</td>\n",
       "      <td>13.717504</td>\n",
       "      <td>43.768236</td>\n",
       "      <td>1.767357</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>2.168104</td>\n",
       "      <td>0.738754</td>\n",
       "      <td>6.835124</td>\n",
       "      <td>3.048185</td>\n",
       "      <td>0.000439</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>1089.183071</td>\n",
       "      <td>1089.181493</td>\n",
       "      <td>10.923567</td>\n",
       "      <td>39.314013</td>\n",
       "      <td>1.742044</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>2.237118</td>\n",
       "      <td>0.899072</td>\n",
       "      <td>8.591055</td>\n",
       "      <td>3.845992</td>\n",
       "      <td>0.001577</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>690.862942</td>\n",
       "      <td>690.861705</td>\n",
       "      <td>10.253059</td>\n",
       "      <td>28.755326</td>\n",
       "      <td>1.615218</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>2.711200</td>\n",
       "      <td>1.179674</td>\n",
       "      <td>6.251278</td>\n",
       "      <td>2.535802</td>\n",
       "      <td>0.001237</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>208.515243</td>\n",
       "      <td>208.505275</td>\n",
       "      <td>5.065009</td>\n",
       "      <td>8.908716</td>\n",
       "      <td>2.742966</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>3.781187</td>\n",
       "      <td>1.788185</td>\n",
       "      <td>7.408262</td>\n",
       "      <td>2.810039</td>\n",
       "      <td>0.009968</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>112.419911</td>\n",
       "      <td>112.417582</td>\n",
       "      <td>3.874235</td>\n",
       "      <td>5.474216</td>\n",
       "      <td>1.541600</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>3.009121</td>\n",
       "      <td>1.639157</td>\n",
       "      <td>4.743060</td>\n",
       "      <td>1.551951</td>\n",
       "      <td>0.002329</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>254.660063</td>\n",
       "      <td>254.657570</td>\n",
       "      <td>3.913260</td>\n",
       "      <td>10.800301</td>\n",
       "      <td>1.475802</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>2.519583</td>\n",
       "      <td>1.120850</td>\n",
       "      <td>3.960554</td>\n",
       "      <td>1.419852</td>\n",
       "      <td>0.002493</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>867.867329</td>\n",
       "      <td>867.860438</td>\n",
       "      <td>4.021469</td>\n",
       "      <td>21.440359</td>\n",
       "      <td>1.054237</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>2.198737</td>\n",
       "      <td>1.180014</td>\n",
       "      <td>3.908172</td>\n",
       "      <td>1.364079</td>\n",
       "      <td>0.006891</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>140.034425</td>\n",
       "      <td>140.033138</td>\n",
       "      <td>3.159021</td>\n",
       "      <td>4.506689</td>\n",
       "      <td>1.396247</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>2.394188</td>\n",
       "      <td>1.217681</td>\n",
       "      <td>4.661731</td>\n",
       "      <td>1.722025</td>\n",
       "      <td>0.001287</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.002401   297.894836   297.892436   7.128450  18.727233   \n",
       "1     4043  0.002011   816.365335   816.363323  18.999679  65.469710   \n",
       "2     4497  0.000439   604.868628   604.868189  13.717504  43.768236   \n",
       "3     4130  0.001577  1089.183071  1089.181493  10.923567  39.314013   \n",
       "4     4246  0.001237   690.862942   690.861705  10.253059  28.755326   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.009968   208.515243   208.505275   5.065009   8.908716   \n",
       "180   3707  0.002329   112.419911   112.417582   3.874235   5.474216   \n",
       "181   4445  0.002493   254.660063   254.657570   3.913260  10.800301   \n",
       "182   4559  0.006891   867.867329   867.860438   4.021469  21.440359   \n",
       "183   3838  0.001287   140.034425   140.033138   3.159021   4.506689   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332530  2.177517  2.177517  1.147045  5.751471  2.302213  0.002401   \n",
       "1    1.327944  1.940239  1.940239  0.872419  8.942207  4.034894  0.002011   \n",
       "2    1.767357  2.168104  2.168104  0.738754  6.835124  3.048185  0.000439   \n",
       "3    1.742044  2.237118  2.237118  0.899072  8.591055  3.845992  0.001577   \n",
       "4    1.615218  2.711200  2.711200  1.179674  6.251278  2.535802  0.001237   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.742966  3.781187  3.781187  1.788185  7.408262  2.810039  0.009968   \n",
       "180  1.541600  3.009121  3.009121  1.639157  4.743060  1.551951  0.002329   \n",
       "181  1.475802  2.519583  2.519583  1.120850  3.960554  1.419852  0.002493   \n",
       "182  1.054237  2.198737  2.198737  1.180014  3.908172  1.364079  0.006891   \n",
       "183  1.396247  2.394188  2.394188  1.217681  4.661731  1.722025  0.001287   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.007306</td>\n",
       "      <td>1474.830574</td>\n",
       "      <td>1474.823268</td>\n",
       "      <td>13.833578</td>\n",
       "      <td>51.261317</td>\n",
       "      <td>3.063889</td>\n",
       "      <td>3.952603</td>\n",
       "      <td>3.952603</td>\n",
       "      <td>1.509026</td>\n",
       "      <td>12.921044</td>\n",
       "      <td>5.706009</td>\n",
       "      <td>0.007306</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.023472</td>\n",
       "      <td>3913.831991</td>\n",
       "      <td>3913.830991</td>\n",
       "      <td>18.005092</td>\n",
       "      <td>84.657266</td>\n",
       "      <td>12.181799</td>\n",
       "      <td>12.803563</td>\n",
       "      <td>12.803563</td>\n",
       "      <td>3.381976</td>\n",
       "      <td>30.301611</td>\n",
       "      <td>13.667355</td>\n",
       "      <td>0.023472</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000029</td>\n",
       "      <td>17.212054</td>\n",
       "      <td>17.210855</td>\n",
       "      <td>1.495567</td>\n",
       "      <td>1.502241</td>\n",
       "      <td>0.434431</td>\n",
       "      <td>0.418657</td>\n",
       "      <td>0.418657</td>\n",
       "      <td>0.111299</td>\n",
       "      <td>1.427474</td>\n",
       "      <td>0.658087</td>\n",
       "      <td>0.000029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000587</td>\n",
       "      <td>278.408534</td>\n",
       "      <td>278.408060</td>\n",
       "      <td>5.322401</td>\n",
       "      <td>15.064658</td>\n",
       "      <td>1.233124</td>\n",
       "      <td>1.730390</td>\n",
       "      <td>1.730390</td>\n",
       "      <td>0.613695</td>\n",
       "      <td>3.932978</td>\n",
       "      <td>1.567425</td>\n",
       "      <td>0.000587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.001755</td>\n",
       "      <td>571.373956</td>\n",
       "      <td>571.371685</td>\n",
       "      <td>9.705959</td>\n",
       "      <td>29.501283</td>\n",
       "      <td>1.716924</td>\n",
       "      <td>2.462270</td>\n",
       "      <td>2.462270</td>\n",
       "      <td>0.996144</td>\n",
       "      <td>6.185707</td>\n",
       "      <td>2.412672</td>\n",
       "      <td>0.001755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.004803</td>\n",
       "      <td>1077.851569</td>\n",
       "      <td>1077.850197</td>\n",
       "      <td>16.156704</td>\n",
       "      <td>57.198345</td>\n",
       "      <td>2.484913</td>\n",
       "      <td>3.570954</td>\n",
       "      <td>3.570954</td>\n",
       "      <td>1.526624</td>\n",
       "      <td>9.554061</td>\n",
       "      <td>4.043003</td>\n",
       "      <td>0.004803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.258760</td>\n",
       "      <td>34388.052316</td>\n",
       "      <td>34388.049567</td>\n",
       "      <td>210.393766</td>\n",
       "      <td>827.451580</td>\n",
       "      <td>163.045469</td>\n",
       "      <td>170.540901</td>\n",
       "      <td>170.540901</td>\n",
       "      <td>43.855534</td>\n",
       "      <td>376.294759</td>\n",
       "      <td>166.219613</td>\n",
       "      <td>0.258760</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min           max           ptp        mean  \\\n",
       "count   184.000000  184.000000    184.000000    184.000000  184.000000   \n",
       "mean   4275.956522    0.007306   1474.830574   1474.823268   13.833578   \n",
       "std    1022.520436    0.023472   3913.831991   3913.830991   18.005092   \n",
       "min    1013.000000    0.000029     17.212054     17.210855    1.495567   \n",
       "25%    3804.000000    0.000587    278.408534    278.408060    5.322401   \n",
       "50%    4266.000000    0.001755    571.373956    571.371685    9.705959   \n",
       "75%    4703.500000    0.004803   1077.851569   1077.850197   16.156704   \n",
       "max    7479.000000    0.258760  34388.052316  34388.049567  210.393766   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean    51.261317    3.063889    3.952603    3.952603    1.509026   12.921044   \n",
       "std     84.657266   12.181799   12.803563   12.803563    3.381976   30.301611   \n",
       "min      1.502241    0.434431    0.418657    0.418657    0.111299    1.427474   \n",
       "25%     15.064658    1.233124    1.730390    1.730390    0.613695    3.932978   \n",
       "50%     29.501283    1.716924    2.462270    2.462270    0.996144    6.185707   \n",
       "75%     57.198345    2.484913    3.570954    3.570954    1.526624    9.554061   \n",
       "max    827.451580  163.045469  170.540901  170.540901   43.855534  376.294759   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     5.706009    0.007306  \n",
       "std     13.667355    0.023472  \n",
       "min      0.658087    0.000029  \n",
       "25%      1.567425    0.000587  \n",
       "50%      2.412672    0.001755  \n",
       "75%      4.043003    0.004803  \n",
       "max    166.219613    0.258760  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "510edc5606eb41479b874e46aa02b76e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "final_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_cam_wt0_old_cam_1m_dem/run-final_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4281</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>17.731137</td>\n",
       "      <td>17.728427</td>\n",
       "      <td>1.128330</td>\n",
       "      <td>0.843666</td>\n",
       "      <td>0.659206</td>\n",
       "      <td>0.989736</td>\n",
       "      <td>0.989736</td>\n",
       "      <td>0.440882</td>\n",
       "      <td>1.753247</td>\n",
       "      <td>0.656183</td>\n",
       "      <td>0.002710</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3995</td>\n",
       "      <td>0.002263</td>\n",
       "      <td>13.314311</td>\n",
       "      <td>13.312047</td>\n",
       "      <td>0.791736</td>\n",
       "      <td>0.738802</td>\n",
       "      <td>0.477086</td>\n",
       "      <td>0.620256</td>\n",
       "      <td>0.620256</td>\n",
       "      <td>0.252272</td>\n",
       "      <td>1.279127</td>\n",
       "      <td>0.513428</td>\n",
       "      <td>0.002263</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4457</td>\n",
       "      <td>0.001976</td>\n",
       "      <td>15.790855</td>\n",
       "      <td>15.788879</td>\n",
       "      <td>0.748826</td>\n",
       "      <td>0.724657</td>\n",
       "      <td>0.437955</td>\n",
       "      <td>0.604642</td>\n",
       "      <td>0.604642</td>\n",
       "      <td>0.251548</td>\n",
       "      <td>1.160074</td>\n",
       "      <td>0.454263</td>\n",
       "      <td>0.001976</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4082</td>\n",
       "      <td>0.000613</td>\n",
       "      <td>26.374997</td>\n",
       "      <td>26.374384</td>\n",
       "      <td>0.625167</td>\n",
       "      <td>0.912248</td>\n",
       "      <td>0.317050</td>\n",
       "      <td>0.413522</td>\n",
       "      <td>0.413522</td>\n",
       "      <td>0.175526</td>\n",
       "      <td>0.934969</td>\n",
       "      <td>0.379722</td>\n",
       "      <td>0.000613</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4194</td>\n",
       "      <td>0.000186</td>\n",
       "      <td>14.991876</td>\n",
       "      <td>14.991690</td>\n",
       "      <td>0.583542</td>\n",
       "      <td>0.767494</td>\n",
       "      <td>0.307664</td>\n",
       "      <td>0.402466</td>\n",
       "      <td>0.402466</td>\n",
       "      <td>0.166495</td>\n",
       "      <td>0.870602</td>\n",
       "      <td>0.352053</td>\n",
       "      <td>0.000186</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3930</td>\n",
       "      <td>0.000131</td>\n",
       "      <td>24.060396</td>\n",
       "      <td>24.060264</td>\n",
       "      <td>0.839442</td>\n",
       "      <td>1.312705</td>\n",
       "      <td>0.434030</td>\n",
       "      <td>0.467365</td>\n",
       "      <td>0.467365</td>\n",
       "      <td>0.149617</td>\n",
       "      <td>1.351304</td>\n",
       "      <td>0.600843</td>\n",
       "      <td>0.000131</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3666</td>\n",
       "      <td>0.000727</td>\n",
       "      <td>18.563945</td>\n",
       "      <td>18.563218</td>\n",
       "      <td>0.790800</td>\n",
       "      <td>1.083698</td>\n",
       "      <td>0.432168</td>\n",
       "      <td>0.476676</td>\n",
       "      <td>0.476676</td>\n",
       "      <td>0.162510</td>\n",
       "      <td>1.302698</td>\n",
       "      <td>0.570094</td>\n",
       "      <td>0.000727</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4396</td>\n",
       "      <td>0.001082</td>\n",
       "      <td>19.540171</td>\n",
       "      <td>19.539088</td>\n",
       "      <td>0.744854</td>\n",
       "      <td>1.016211</td>\n",
       "      <td>0.408251</td>\n",
       "      <td>0.461241</td>\n",
       "      <td>0.461241</td>\n",
       "      <td>0.157893</td>\n",
       "      <td>1.176885</td>\n",
       "      <td>0.509496</td>\n",
       "      <td>0.001082</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4506</td>\n",
       "      <td>0.000052</td>\n",
       "      <td>14.104749</td>\n",
       "      <td>14.104698</td>\n",
       "      <td>0.664446</td>\n",
       "      <td>0.889771</td>\n",
       "      <td>0.370354</td>\n",
       "      <td>0.422475</td>\n",
       "      <td>0.422475</td>\n",
       "      <td>0.140431</td>\n",
       "      <td>1.009841</td>\n",
       "      <td>0.434705</td>\n",
       "      <td>0.000052</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3782</td>\n",
       "      <td>0.000392</td>\n",
       "      <td>16.545027</td>\n",
       "      <td>16.544635</td>\n",
       "      <td>0.818794</td>\n",
       "      <td>1.133600</td>\n",
       "      <td>0.448396</td>\n",
       "      <td>0.490425</td>\n",
       "      <td>0.490425</td>\n",
       "      <td>0.155856</td>\n",
       "      <td>1.297171</td>\n",
       "      <td>0.570657</td>\n",
       "      <td>0.000392</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min        max        ptp      mean       std      nmad  \\\n",
       "0     4281  0.002710  17.731137  17.728427  1.128330  0.843666  0.659206   \n",
       "1     3995  0.002263  13.314311  13.312047  0.791736  0.738802  0.477086   \n",
       "2     4457  0.001976  15.790855  15.788879  0.748826  0.724657  0.437955   \n",
       "3     4082  0.000613  26.374997  26.374384  0.625167  0.912248  0.317050   \n",
       "4     4194  0.000186  14.991876  14.991690  0.583542  0.767494  0.307664   \n",
       "..     ...       ...        ...        ...       ...       ...       ...   \n",
       "179   3930  0.000131  24.060396  24.060264  0.839442  1.312705  0.434030   \n",
       "180   3666  0.000727  18.563945  18.563218  0.790800  1.083698  0.432168   \n",
       "181   4396  0.001082  19.540171  19.539088  0.744854  1.016211  0.408251   \n",
       "182   4506  0.000052  14.104749  14.104698  0.664446  0.889771  0.370354   \n",
       "183   3782  0.000392  16.545027  16.544635  0.818794  1.133600  0.448396   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    0.989736  0.989736  0.440882  1.753247  0.656183  0.002710   \n",
       "1    0.620256  0.620256  0.252272  1.279127  0.513428  0.002263   \n",
       "2    0.604642  0.604642  0.251548  1.160074  0.454263  0.001976   \n",
       "3    0.413522  0.413522  0.175526  0.934969  0.379722  0.000613   \n",
       "4    0.402466  0.402466  0.166495  0.870602  0.352053  0.000186   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "179  0.467365  0.467365  0.149617  1.351304  0.600843  0.000131   \n",
       "180  0.476676  0.476676  0.162510  1.302698  0.570094  0.000727   \n",
       "181  0.461241  0.461241  0.157893  1.176885  0.509496  0.001082   \n",
       "182  0.422475  0.422475  0.140431  1.009841  0.434705  0.000052   \n",
       "183  0.490425  0.490425  0.155856  1.297171  0.570657  0.000392   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4188.956522</td>\n",
       "      <td>0.000530</td>\n",
       "      <td>18.762729</td>\n",
       "      <td>18.762198</td>\n",
       "      <td>0.773586</td>\n",
       "      <td>1.074876</td>\n",
       "      <td>0.404943</td>\n",
       "      <td>0.477674</td>\n",
       "      <td>0.477674</td>\n",
       "      <td>0.173532</td>\n",
       "      <td>1.200210</td>\n",
       "      <td>0.513339</td>\n",
       "      <td>0.000530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1038.469749</td>\n",
       "      <td>0.000870</td>\n",
       "      <td>5.467333</td>\n",
       "      <td>5.466983</td>\n",
       "      <td>0.314673</td>\n",
       "      <td>0.354385</td>\n",
       "      <td>0.167919</td>\n",
       "      <td>0.242501</td>\n",
       "      <td>0.242501</td>\n",
       "      <td>0.107833</td>\n",
       "      <td>0.472310</td>\n",
       "      <td>0.190482</td>\n",
       "      <td>0.000870</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>978.000000</td>\n",
       "      <td>0.000005</td>\n",
       "      <td>7.212907</td>\n",
       "      <td>7.212374</td>\n",
       "      <td>0.418177</td>\n",
       "      <td>0.561152</td>\n",
       "      <td>0.209220</td>\n",
       "      <td>0.273455</td>\n",
       "      <td>0.273455</td>\n",
       "      <td>0.103193</td>\n",
       "      <td>0.590899</td>\n",
       "      <td>0.240060</td>\n",
       "      <td>0.000005</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3682.750000</td>\n",
       "      <td>0.000133</td>\n",
       "      <td>15.352801</td>\n",
       "      <td>15.352690</td>\n",
       "      <td>0.636976</td>\n",
       "      <td>0.910336</td>\n",
       "      <td>0.334175</td>\n",
       "      <td>0.394701</td>\n",
       "      <td>0.394701</td>\n",
       "      <td>0.135666</td>\n",
       "      <td>0.973341</td>\n",
       "      <td>0.409777</td>\n",
       "      <td>0.000133</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4195.000000</td>\n",
       "      <td>0.000358</td>\n",
       "      <td>18.002142</td>\n",
       "      <td>18.001942</td>\n",
       "      <td>0.768513</td>\n",
       "      <td>1.044788</td>\n",
       "      <td>0.402072</td>\n",
       "      <td>0.455978</td>\n",
       "      <td>0.455978</td>\n",
       "      <td>0.156147</td>\n",
       "      <td>1.187552</td>\n",
       "      <td>0.512730</td>\n",
       "      <td>0.000358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4628.500000</td>\n",
       "      <td>0.000627</td>\n",
       "      <td>21.591884</td>\n",
       "      <td>21.591040</td>\n",
       "      <td>0.838727</td>\n",
       "      <td>1.177401</td>\n",
       "      <td>0.447652</td>\n",
       "      <td>0.499100</td>\n",
       "      <td>0.499100</td>\n",
       "      <td>0.185697</td>\n",
       "      <td>1.331382</td>\n",
       "      <td>0.583008</td>\n",
       "      <td>0.000627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7394.000000</td>\n",
       "      <td>0.010086</td>\n",
       "      <td>48.421325</td>\n",
       "      <td>48.411239</td>\n",
       "      <td>4.463485</td>\n",
       "      <td>4.471345</td>\n",
       "      <td>2.326184</td>\n",
       "      <td>3.423847</td>\n",
       "      <td>3.423847</td>\n",
       "      <td>1.487386</td>\n",
       "      <td>6.445010</td>\n",
       "      <td>2.478812</td>\n",
       "      <td>0.010086</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min         max         ptp        mean  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean   4188.956522    0.000530   18.762729   18.762198    0.773586   \n",
       "std    1038.469749    0.000870    5.467333    5.466983    0.314673   \n",
       "min     978.000000    0.000005    7.212907    7.212374    0.418177   \n",
       "25%    3682.750000    0.000133   15.352801   15.352690    0.636976   \n",
       "50%    4195.000000    0.000358   18.002142   18.001942    0.768513   \n",
       "75%    4628.500000    0.000627   21.591884   21.591040    0.838727   \n",
       "max    7394.000000    0.010086   48.421325   48.411239    4.463485   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     1.074876    0.404943    0.477674    0.477674    0.173532    1.200210   \n",
       "std      0.354385    0.167919    0.242501    0.242501    0.107833    0.472310   \n",
       "min      0.561152    0.209220    0.273455    0.273455    0.103193    0.590899   \n",
       "25%      0.910336    0.334175    0.394701    0.394701    0.135666    0.973341   \n",
       "50%      1.044788    0.402072    0.455978    0.455978    0.156147    1.187552   \n",
       "75%      1.177401    0.447652    0.499100    0.499100    0.185697    1.331382   \n",
       "max      4.471345    2.326184    3.423847    3.423847    1.487386    6.445010   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     0.513339    0.000530  \n",
       "std      0.190482    0.000870  \n",
       "min      0.240060    0.000005  \n",
       "25%      0.409777    0.000133  \n",
       "50%      0.512730    0.000358  \n",
       "75%      0.583008    0.000627  \n",
       "max      2.478812    0.010086  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>978</td>\n",
       "      <td>0.010086</td>\n",
       "      <td>48.421325</td>\n",
       "      <td>48.411239</td>\n",
       "      <td>4.463485</td>\n",
       "      <td>4.471345</td>\n",
       "      <td>2.326184</td>\n",
       "      <td>3.423847</td>\n",
       "      <td>3.423847</td>\n",
       "      <td>1.487386</td>\n",
       "      <td>6.44501</td>\n",
       "      <td>2.478812</td>\n",
       "      <td>0.010086</td>\n",
       "      <td>20190827_214711_ssc9d3_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    count       min        max        ptp      mean       std      nmad  \\\n",
       "42    978  0.010086  48.421325  48.411239  4.463485  4.471345  2.326184   \n",
       "\n",
       "         med    median       p16      p84    spread      mode  \\\n",
       "42  3.423847  3.423847  1.487386  6.44501  2.478812  0.010086   \n",
       "\n",
       "                                               camera  \n",
       "42  20190827_214711_ssc9d3_0005_basic_panchromatic...  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error[final_error['median']>1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  58,   48,   40,   48,   52,   85,   39,  159,   86,  111,   57,\n",
       "         56,   54,   77,   66,   20,   30,   27,   26,  122,  107,   44,\n",
       "         29,   85,   82,   81,  140,  135,   42,   47,   78,   46,  108,\n",
       "         31,   97,   64,   65,   53,   39,   22,    7,  195, 1941,  171,\n",
       "         40,   56,   22,   91,   49,   65,   39,   40,   41,   72,   42,\n",
       "         39,   46,   32,   46,   53,   47,   52,   80,   44,  124,  108,\n",
       "         56,   68,   63,   63,   18,   38,   67,   71,   35,   19,   34,\n",
       "         21,   18,   68,  100,   37,   34,   18,   72,   69,   43,   35,\n",
       "         35,   78,   68,   38,   30,   65,   40,   82,   54,   32,   53,\n",
       "         56,   58,   29,   54,    9,   38,   32,   21,   20,   58,  944,\n",
       "        913,   49,   35,   60,   19,   57,   29,   47,   67,   36,   63,\n",
       "         61,   27,   53,   41,   44,   25,   54,   43,   50,   52,   85,\n",
       "         89,   95,  151,   89,   79,   68,   41,   42,   55,   64,   28,\n",
       "         26,   29,    7,   15,   83,   91,   38,   26,   72,   76,   85,\n",
       "        157,  104,   86,   53,   57,   44,   82,   56,   53,   85,   51,\n",
       "         67,   17,   37,   28,   50, 1130,  874,   45,   66,   16,   61,\n",
       "         35,   44,   54,   59,   41,   49,   53,   56])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error['count'].values - final_error['count'].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Higher parameter tolerance and robust threshold were able to do a better job, but there are still sime cameras where large number of points were excluded."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Case 4: Bundle adjustment using camera obtained from 10 m DEM\n",
    "\n",
    "Does the high robust threshold and parameter tolerance work in each case ? Lets check with the 10 m DEM produced camera which worked with default ASP values for these. During bundle adjustment, robust threshold = 10, 0 camera weight, parameter tolerance = 1e-14 were used.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e3594672deec45d9b907fe44cc612936",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "init_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_cam_wt0/run-initial_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>297.670674</td>\n",
       "      <td>297.667621</td>\n",
       "      <td>7.360739</td>\n",
       "      <td>19.904727</td>\n",
       "      <td>1.332610</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>1.136318</td>\n",
       "      <td>5.632678</td>\n",
       "      <td>2.248180</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>797.392087</td>\n",
       "      <td>797.391593</td>\n",
       "      <td>18.863889</td>\n",
       "      <td>64.350225</td>\n",
       "      <td>1.327428</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>0.876128</td>\n",
       "      <td>9.140801</td>\n",
       "      <td>4.132336</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>606.671866</td>\n",
       "      <td>606.671702</td>\n",
       "      <td>13.832706</td>\n",
       "      <td>43.895696</td>\n",
       "      <td>1.765301</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>0.743774</td>\n",
       "      <td>6.839131</td>\n",
       "      <td>3.047679</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>1091.100096</td>\n",
       "      <td>1091.096886</td>\n",
       "      <td>10.989787</td>\n",
       "      <td>39.771488</td>\n",
       "      <td>1.756563</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>0.902891</td>\n",
       "      <td>8.642462</td>\n",
       "      <td>3.869786</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>689.207895</td>\n",
       "      <td>689.202708</td>\n",
       "      <td>12.100672</td>\n",
       "      <td>36.260374</td>\n",
       "      <td>1.613689</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>1.192010</td>\n",
       "      <td>6.246969</td>\n",
       "      <td>2.527479</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>208.346355</td>\n",
       "      <td>208.344149</td>\n",
       "      <td>5.190641</td>\n",
       "      <td>8.775557</td>\n",
       "      <td>2.777135</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>1.875839</td>\n",
       "      <td>7.568493</td>\n",
       "      <td>2.846327</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>107.675981</td>\n",
       "      <td>107.669953</td>\n",
       "      <td>3.677115</td>\n",
       "      <td>5.328733</td>\n",
       "      <td>1.465054</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>1.517690</td>\n",
       "      <td>4.521464</td>\n",
       "      <td>1.501887</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>254.576283</td>\n",
       "      <td>254.574545</td>\n",
       "      <td>4.042884</td>\n",
       "      <td>11.977195</td>\n",
       "      <td>1.425692</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>1.132042</td>\n",
       "      <td>3.910024</td>\n",
       "      <td>1.388991</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>867.425983</td>\n",
       "      <td>867.422957</td>\n",
       "      <td>4.258796</td>\n",
       "      <td>22.041762</td>\n",
       "      <td>1.093660</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>1.232185</td>\n",
       "      <td>4.121481</td>\n",
       "      <td>1.444648</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>138.225976</td>\n",
       "      <td>138.219066</td>\n",
       "      <td>3.342914</td>\n",
       "      <td>4.403954</td>\n",
       "      <td>1.145942</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>1.615534</td>\n",
       "      <td>4.838674</td>\n",
       "      <td>1.611570</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.003053   297.670674   297.667621   7.360739  19.904727   \n",
       "1     4043  0.000494   797.392087   797.391593  18.863889  64.350225   \n",
       "2     4497  0.000164   606.671866   606.671702  13.832706  43.895696   \n",
       "3     4130  0.003210  1091.100096  1091.096886  10.989787  39.771488   \n",
       "4     4246  0.005187   689.207895   689.202708  12.100672  36.260374   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.002206   208.346355   208.344149   5.190641   8.775557   \n",
       "180   3707  0.006028   107.675981   107.669953   3.677115   5.328733   \n",
       "181   4445  0.001738   254.576283   254.574545   4.042884  11.977195   \n",
       "182   4559  0.003026   867.425983   867.422957   4.258796  22.041762   \n",
       "183   3838  0.006910   138.225976   138.219066   3.342914   4.403954   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332610  2.169127  2.169127  1.136318  5.632678  2.248180  0.003053   \n",
       "1    1.327428  1.948240  1.948240  0.876128  9.140801  4.132336  0.000494   \n",
       "2    1.765301  2.172162  2.172162  0.743774  6.839131  3.047679  0.000164   \n",
       "3    1.756563  2.250562  2.250562  0.902891  8.642462  3.869786  0.003210   \n",
       "4    1.613689  2.715130  2.715130  1.192010  6.246969  2.527479  0.005187   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.777135  3.940981  3.940981  1.875839  7.568493  2.846327  0.002206   \n",
       "180  1.465054  2.805216  2.805216  1.517690  4.521464  1.501887  0.006028   \n",
       "181  1.425692  2.535071  2.535071  1.132042  3.910024  1.388991  0.001738   \n",
       "182  1.093660  2.293505  2.293505  1.232185  4.121481  1.444648  0.003026   \n",
       "183  1.145942  2.495953  2.495953  1.615534  4.838674  1.611570  0.006910   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.009337</td>\n",
       "      <td>1586.922621</td>\n",
       "      <td>1586.913284</td>\n",
       "      <td>11.728639</td>\n",
       "      <td>54.578254</td>\n",
       "      <td>1.849336</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>1.191957</td>\n",
       "      <td>8.952492</td>\n",
       "      <td>3.880267</td>\n",
       "      <td>0.009337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.028170</td>\n",
       "      <td>5350.087198</td>\n",
       "      <td>5350.086310</td>\n",
       "      <td>9.951353</td>\n",
       "      <td>137.854460</td>\n",
       "      <td>1.034153</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>0.921782</td>\n",
       "      <td>10.570077</td>\n",
       "      <td>5.228412</td>\n",
       "      <td>0.028170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000007</td>\n",
       "      <td>17.017930</td>\n",
       "      <td>17.016424</td>\n",
       "      <td>1.548698</td>\n",
       "      <td>1.497151</td>\n",
       "      <td>0.411130</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.087845</td>\n",
       "      <td>1.439080</td>\n",
       "      <td>0.675617</td>\n",
       "      <td>0.000007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000598</td>\n",
       "      <td>305.096271</td>\n",
       "      <td>305.093050</td>\n",
       "      <td>5.181919</td>\n",
       "      <td>15.633537</td>\n",
       "      <td>1.170797</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>0.571162</td>\n",
       "      <td>3.821715</td>\n",
       "      <td>1.475505</td>\n",
       "      <td>0.000598</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.001715</td>\n",
       "      <td>616.924352</td>\n",
       "      <td>616.921670</td>\n",
       "      <td>9.262133</td>\n",
       "      <td>29.014861</td>\n",
       "      <td>1.639866</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>1.011007</td>\n",
       "      <td>5.472475</td>\n",
       "      <td>2.140856</td>\n",
       "      <td>0.001715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.006019</td>\n",
       "      <td>1005.461775</td>\n",
       "      <td>1005.458903</td>\n",
       "      <td>13.631376</td>\n",
       "      <td>51.271993</td>\n",
       "      <td>2.197642</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>1.434870</td>\n",
       "      <td>8.566359</td>\n",
       "      <td>3.608012</td>\n",
       "      <td>0.006019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.213001</td>\n",
       "      <td>55498.001512</td>\n",
       "      <td>55497.996204</td>\n",
       "      <td>64.996068</td>\n",
       "      <td>1572.526637</td>\n",
       "      <td>6.733989</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>4.950465</td>\n",
       "      <td>65.216577</td>\n",
       "      <td>31.890185</td>\n",
       "      <td>0.213001</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min           max           ptp        mean  \\\n",
       "count   184.000000  184.000000    184.000000    184.000000  184.000000   \n",
       "mean   4275.956522    0.009337   1586.922621   1586.913284   11.728639   \n",
       "std    1022.520436    0.028170   5350.087198   5350.086310    9.951353   \n",
       "min    1013.000000    0.000007     17.017930     17.016424    1.548698   \n",
       "25%    3804.000000    0.000598    305.096271    305.093050    5.181919   \n",
       "50%    4266.000000    0.001715    616.924352    616.921670    9.262133   \n",
       "75%    4703.500000    0.006019   1005.461775   1005.458903   13.631376   \n",
       "max    7479.000000    0.213001  55498.001512  55497.996204   64.996068   \n",
       "\n",
       "               std        nmad         med      median         p16  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     54.578254    1.849336    2.710945    2.710945    1.191957   \n",
       "std     137.854460    1.034153    1.636611    1.636611    0.921782   \n",
       "min       1.497151    0.411130    0.369011    0.369011    0.087845   \n",
       "25%      15.633537    1.170797    1.619642    1.619642    0.571162   \n",
       "50%      29.014861    1.639866    2.427164    2.427164    1.011007   \n",
       "75%      51.271993    2.197642    3.441582    3.441582    1.434870   \n",
       "max    1572.526637    6.733989    9.153704    9.153704    4.950465   \n",
       "\n",
       "              p84      spread        mode  \n",
       "count  184.000000  184.000000  184.000000  \n",
       "mean     8.952492    3.880267    0.009337  \n",
       "std     10.570077    5.228412    0.028170  \n",
       "min      1.439080    0.675617    0.000007  \n",
       "25%      3.821715    1.475505    0.000598  \n",
       "50%      5.472475    2.140856    0.001715  \n",
       "75%      8.566359    3.608012    0.006019  \n",
       "max     65.216577   31.890185    0.213001  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3e4e4c8016c44637a0395f6a85c0c877",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "final_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_cam_wt0/run-final_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4281</td>\n",
       "      <td>0.001115</td>\n",
       "      <td>17.581176</td>\n",
       "      <td>17.580061</td>\n",
       "      <td>1.121857</td>\n",
       "      <td>0.841556</td>\n",
       "      <td>0.657334</td>\n",
       "      <td>0.985149</td>\n",
       "      <td>0.985149</td>\n",
       "      <td>0.433926</td>\n",
       "      <td>1.744068</td>\n",
       "      <td>0.655071</td>\n",
       "      <td>0.001115</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3995</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>13.324990</td>\n",
       "      <td>13.324434</td>\n",
       "      <td>0.790412</td>\n",
       "      <td>0.737864</td>\n",
       "      <td>0.472848</td>\n",
       "      <td>0.618052</td>\n",
       "      <td>0.618052</td>\n",
       "      <td>0.252286</td>\n",
       "      <td>1.273092</td>\n",
       "      <td>0.510403</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4457</td>\n",
       "      <td>0.002377</td>\n",
       "      <td>15.841765</td>\n",
       "      <td>15.839388</td>\n",
       "      <td>0.745965</td>\n",
       "      <td>0.724634</td>\n",
       "      <td>0.437979</td>\n",
       "      <td>0.599418</td>\n",
       "      <td>0.599418</td>\n",
       "      <td>0.249107</td>\n",
       "      <td>1.156235</td>\n",
       "      <td>0.453564</td>\n",
       "      <td>0.002377</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4082</td>\n",
       "      <td>0.000220</td>\n",
       "      <td>26.365852</td>\n",
       "      <td>26.365632</td>\n",
       "      <td>0.625205</td>\n",
       "      <td>0.912050</td>\n",
       "      <td>0.317708</td>\n",
       "      <td>0.413881</td>\n",
       "      <td>0.413881</td>\n",
       "      <td>0.174261</td>\n",
       "      <td>0.934031</td>\n",
       "      <td>0.379885</td>\n",
       "      <td>0.000220</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4194</td>\n",
       "      <td>0.001240</td>\n",
       "      <td>15.014138</td>\n",
       "      <td>15.012898</td>\n",
       "      <td>0.583618</td>\n",
       "      <td>0.767274</td>\n",
       "      <td>0.309124</td>\n",
       "      <td>0.401996</td>\n",
       "      <td>0.401996</td>\n",
       "      <td>0.166970</td>\n",
       "      <td>0.865850</td>\n",
       "      <td>0.349440</td>\n",
       "      <td>0.001240</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3930</td>\n",
       "      <td>0.000289</td>\n",
       "      <td>24.061270</td>\n",
       "      <td>24.060981</td>\n",
       "      <td>0.839439</td>\n",
       "      <td>1.312721</td>\n",
       "      <td>0.433218</td>\n",
       "      <td>0.467533</td>\n",
       "      <td>0.467533</td>\n",
       "      <td>0.149940</td>\n",
       "      <td>1.351433</td>\n",
       "      <td>0.600747</td>\n",
       "      <td>0.000289</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3666</td>\n",
       "      <td>0.000722</td>\n",
       "      <td>18.563330</td>\n",
       "      <td>18.562608</td>\n",
       "      <td>0.790806</td>\n",
       "      <td>1.083695</td>\n",
       "      <td>0.432087</td>\n",
       "      <td>0.476572</td>\n",
       "      <td>0.476572</td>\n",
       "      <td>0.162695</td>\n",
       "      <td>1.302384</td>\n",
       "      <td>0.569844</td>\n",
       "      <td>0.000722</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4396</td>\n",
       "      <td>0.001039</td>\n",
       "      <td>19.540376</td>\n",
       "      <td>19.539337</td>\n",
       "      <td>0.744909</td>\n",
       "      <td>1.016195</td>\n",
       "      <td>0.407850</td>\n",
       "      <td>0.461139</td>\n",
       "      <td>0.461139</td>\n",
       "      <td>0.158657</td>\n",
       "      <td>1.176597</td>\n",
       "      <td>0.508970</td>\n",
       "      <td>0.001039</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4506</td>\n",
       "      <td>0.000037</td>\n",
       "      <td>14.104488</td>\n",
       "      <td>14.104451</td>\n",
       "      <td>0.664481</td>\n",
       "      <td>0.889755</td>\n",
       "      <td>0.370241</td>\n",
       "      <td>0.422448</td>\n",
       "      <td>0.422448</td>\n",
       "      <td>0.140417</td>\n",
       "      <td>1.009854</td>\n",
       "      <td>0.434719</td>\n",
       "      <td>0.000037</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3782</td>\n",
       "      <td>0.000373</td>\n",
       "      <td>16.545020</td>\n",
       "      <td>16.544647</td>\n",
       "      <td>0.818796</td>\n",
       "      <td>1.133601</td>\n",
       "      <td>0.448425</td>\n",
       "      <td>0.490452</td>\n",
       "      <td>0.490452</td>\n",
       "      <td>0.155856</td>\n",
       "      <td>1.297176</td>\n",
       "      <td>0.570660</td>\n",
       "      <td>0.000373</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min        max        ptp      mean       std      nmad  \\\n",
       "0     4281  0.001115  17.581176  17.580061  1.121857  0.841556  0.657334   \n",
       "1     3995  0.000556  13.324990  13.324434  0.790412  0.737864  0.472848   \n",
       "2     4457  0.002377  15.841765  15.839388  0.745965  0.724634  0.437979   \n",
       "3     4082  0.000220  26.365852  26.365632  0.625205  0.912050  0.317708   \n",
       "4     4194  0.001240  15.014138  15.012898  0.583618  0.767274  0.309124   \n",
       "..     ...       ...        ...        ...       ...       ...       ...   \n",
       "179   3930  0.000289  24.061270  24.060981  0.839439  1.312721  0.433218   \n",
       "180   3666  0.000722  18.563330  18.562608  0.790806  1.083695  0.432087   \n",
       "181   4396  0.001039  19.540376  19.539337  0.744909  1.016195  0.407850   \n",
       "182   4506  0.000037  14.104488  14.104451  0.664481  0.889755  0.370241   \n",
       "183   3782  0.000373  16.545020  16.544647  0.818796  1.133601  0.448425   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    0.985149  0.985149  0.433926  1.744068  0.655071  0.001115   \n",
       "1    0.618052  0.618052  0.252286  1.273092  0.510403  0.000556   \n",
       "2    0.599418  0.599418  0.249107  1.156235  0.453564  0.002377   \n",
       "3    0.413881  0.413881  0.174261  0.934031  0.379885  0.000220   \n",
       "4    0.401996  0.401996  0.166970  0.865850  0.349440  0.001240   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "179  0.467533  0.467533  0.149940  1.351433  0.600747  0.000289   \n",
       "180  0.476572  0.476572  0.162695  1.302384  0.569844  0.000722   \n",
       "181  0.461139  0.461139  0.158657  1.176597  0.508970  0.001039   \n",
       "182  0.422448  0.422448  0.140417  1.009854  0.434719  0.000037   \n",
       "183  0.490452  0.490452  0.155856  1.297176  0.570660  0.000373   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>1.840000e+02</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>1.840000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4220.505435</td>\n",
       "      <td>3.817222e-04</td>\n",
       "      <td>18.647319</td>\n",
       "      <td>18.646937</td>\n",
       "      <td>0.748569</td>\n",
       "      <td>1.045564</td>\n",
       "      <td>0.393789</td>\n",
       "      <td>0.461400</td>\n",
       "      <td>0.461400</td>\n",
       "      <td>0.166559</td>\n",
       "      <td>1.164276</td>\n",
       "      <td>0.498858</td>\n",
       "      <td>3.817222e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1016.354145</td>\n",
       "      <td>4.413084e-04</td>\n",
       "      <td>5.197493</td>\n",
       "      <td>5.197439</td>\n",
       "      <td>0.152623</td>\n",
       "      <td>0.214505</td>\n",
       "      <td>0.090907</td>\n",
       "      <td>0.107360</td>\n",
       "      <td>0.107360</td>\n",
       "      <td>0.046580</td>\n",
       "      <td>0.266366</td>\n",
       "      <td>0.120159</td>\n",
       "      <td>4.413084e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>998.000000</td>\n",
       "      <td>6.256569e-07</td>\n",
       "      <td>7.212916</td>\n",
       "      <td>7.212396</td>\n",
       "      <td>0.418115</td>\n",
       "      <td>0.560460</td>\n",
       "      <td>0.204952</td>\n",
       "      <td>0.268272</td>\n",
       "      <td>0.268272</td>\n",
       "      <td>0.103438</td>\n",
       "      <td>0.584683</td>\n",
       "      <td>0.238175</td>\n",
       "      <td>6.256569e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3756.000000</td>\n",
       "      <td>7.151076e-05</td>\n",
       "      <td>15.321829</td>\n",
       "      <td>15.321748</td>\n",
       "      <td>0.632364</td>\n",
       "      <td>0.900762</td>\n",
       "      <td>0.330647</td>\n",
       "      <td>0.392863</td>\n",
       "      <td>0.392863</td>\n",
       "      <td>0.134347</td>\n",
       "      <td>0.967739</td>\n",
       "      <td>0.408680</td>\n",
       "      <td>7.151076e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4208.500000</td>\n",
       "      <td>2.344650e-04</td>\n",
       "      <td>18.105841</td>\n",
       "      <td>18.105546</td>\n",
       "      <td>0.761343</td>\n",
       "      <td>1.043592</td>\n",
       "      <td>0.401977</td>\n",
       "      <td>0.455702</td>\n",
       "      <td>0.455702</td>\n",
       "      <td>0.156021</td>\n",
       "      <td>1.185551</td>\n",
       "      <td>0.510171</td>\n",
       "      <td>2.344650e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4648.000000</td>\n",
       "      <td>5.209193e-04</td>\n",
       "      <td>21.625117</td>\n",
       "      <td>21.623893</td>\n",
       "      <td>0.831366</td>\n",
       "      <td>1.179295</td>\n",
       "      <td>0.447306</td>\n",
       "      <td>0.499769</td>\n",
       "      <td>0.499769</td>\n",
       "      <td>0.184886</td>\n",
       "      <td>1.318113</td>\n",
       "      <td>0.579954</td>\n",
       "      <td>5.209193e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7428.000000</td>\n",
       "      <td>2.466578e-03</td>\n",
       "      <td>35.067155</td>\n",
       "      <td>35.066530</td>\n",
       "      <td>1.213396</td>\n",
       "      <td>1.820978</td>\n",
       "      <td>0.657334</td>\n",
       "      <td>0.985149</td>\n",
       "      <td>0.985149</td>\n",
       "      <td>0.433926</td>\n",
       "      <td>1.876165</td>\n",
       "      <td>0.841379</td>\n",
       "      <td>2.466578e-03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count           min         max         ptp        mean  \\\n",
       "count   184.000000  1.840000e+02  184.000000  184.000000  184.000000   \n",
       "mean   4220.505435  3.817222e-04   18.647319   18.646937    0.748569   \n",
       "std    1016.354145  4.413084e-04    5.197493    5.197439    0.152623   \n",
       "min     998.000000  6.256569e-07    7.212916    7.212396    0.418115   \n",
       "25%    3756.000000  7.151076e-05   15.321829   15.321748    0.632364   \n",
       "50%    4208.500000  2.344650e-04   18.105841   18.105546    0.761343   \n",
       "75%    4648.000000  5.209193e-04   21.625117   21.623893    0.831366   \n",
       "max    7428.000000  2.466578e-03   35.067155   35.066530    1.213396   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     1.045564    0.393789    0.461400    0.461400    0.166559    1.164276   \n",
       "std      0.214505    0.090907    0.107360    0.107360    0.046580    0.266366   \n",
       "min      0.560460    0.204952    0.268272    0.268272    0.103438    0.584683   \n",
       "25%      0.900762    0.330647    0.392863    0.392863    0.134347    0.967739   \n",
       "50%      1.043592    0.401977    0.455702    0.455702    0.156021    1.185551   \n",
       "75%      1.179295    0.447306    0.499769    0.499769    0.184886    1.318113   \n",
       "max      1.820978    0.657334    0.985149    0.985149    0.433926    1.876165   \n",
       "\n",
       "           spread          mode  \n",
       "count  184.000000  1.840000e+02  \n",
       "mean     0.498858  3.817222e-04  \n",
       "std      0.120159  4.413084e-04  \n",
       "min      0.238175  6.256569e-07  \n",
       "25%      0.408680  7.151076e-05  \n",
       "50%      0.510171  2.344650e-04  \n",
       "75%      0.579954  5.209193e-04  \n",
       "max      0.841379  2.466578e-03  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 58,  48,  40,  48,  52,  85,  39, 159,  86, 111,  57,  55,  54,\n",
       "        77,  66,  20,  30,  27,  26, 123, 106,  43,  29,  85,  84,  48,\n",
       "        41, 135,  42,  47,  78,  46, 108,  31,  97,  64,  65,  53,  39,\n",
       "        22,   7,  55,  90, 152,  40,  56,  22,  91,  49,  65,  39,  40,\n",
       "        41,  72,  42,  39,  46,  32,  46,  53,  47,  52,  80,  44, 124,\n",
       "       108,  56,  68,  63,  62,  18,  38,  67,  71,  35,  19,  34,  21,\n",
       "        18,  68, 101,  36,  34,  18,  72,  68,  45,  27,  30,  77,  68,\n",
       "        38,  30,  65,  41,  83,  54,  32,  53,  56,  58,  29,  54,   9,\n",
       "        37,  31,  20,  20,  42,  64, 101,  46,  35,  60,  19,  57,  29,\n",
       "        47,  67,  36,  63,  61,  27,  53,  41,  44,  25,  54,  43,  50,\n",
       "        52,  85,  89,  95, 151,  89,  79,  67,  40,  42,  55,  64,  28,\n",
       "        26,  29,   7,  15,  84,  91,  37,  26,  71,  76,  51,  70, 101,\n",
       "        86,  53,  57,  45,  82,  56,  53,  85,  51,  67,  17,  36,  27,\n",
       "        51,  63, 132,  44,  66,  16,  61,  35,  44,  54,  59,  41,  49,\n",
       "        53,  56])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error['count'].values - final_error['count'].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The robust threshold parameters worked will with cameras even having high errors. Note that the cameras here were better than 1 m DEM derived cameras."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Case 5: Bundle adjustment using camera obtained from 10 m DEM and using a higher weight for translation parameter, while floating the rotation parameter without any constraint.\n",
    "\n",
    "This example will illustrate if the Does the high robust threshold and parameter tolerance work in each case ? Lets check with the 10 m DEM produced camera which worked with default ASP values for these. During bundle adjustment, robust threshold = 10, 0 camera weight, parameter tolerance = 1e-14 were used.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "36be92a9d80f488a92e8adee2bd21a18",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "init_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_trans_wt04_rotett00/run-initial_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>297.670674</td>\n",
       "      <td>297.667621</td>\n",
       "      <td>7.360739</td>\n",
       "      <td>19.904727</td>\n",
       "      <td>1.332610</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>2.169127</td>\n",
       "      <td>1.136318</td>\n",
       "      <td>5.632678</td>\n",
       "      <td>2.248180</td>\n",
       "      <td>0.003053</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>797.392087</td>\n",
       "      <td>797.391593</td>\n",
       "      <td>18.863889</td>\n",
       "      <td>64.350225</td>\n",
       "      <td>1.327428</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>1.948240</td>\n",
       "      <td>0.876128</td>\n",
       "      <td>9.140801</td>\n",
       "      <td>4.132336</td>\n",
       "      <td>0.000494</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>606.671866</td>\n",
       "      <td>606.671702</td>\n",
       "      <td>13.832706</td>\n",
       "      <td>43.895696</td>\n",
       "      <td>1.765301</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>2.172162</td>\n",
       "      <td>0.743774</td>\n",
       "      <td>6.839131</td>\n",
       "      <td>3.047679</td>\n",
       "      <td>0.000164</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>1091.100096</td>\n",
       "      <td>1091.096886</td>\n",
       "      <td>10.989787</td>\n",
       "      <td>39.771488</td>\n",
       "      <td>1.756563</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>2.250562</td>\n",
       "      <td>0.902891</td>\n",
       "      <td>8.642462</td>\n",
       "      <td>3.869786</td>\n",
       "      <td>0.003210</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>689.207895</td>\n",
       "      <td>689.202708</td>\n",
       "      <td>12.100672</td>\n",
       "      <td>36.260374</td>\n",
       "      <td>1.613689</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>2.715130</td>\n",
       "      <td>1.192010</td>\n",
       "      <td>6.246969</td>\n",
       "      <td>2.527479</td>\n",
       "      <td>0.005187</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>208.346355</td>\n",
       "      <td>208.344149</td>\n",
       "      <td>5.190641</td>\n",
       "      <td>8.775557</td>\n",
       "      <td>2.777135</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>3.940981</td>\n",
       "      <td>1.875839</td>\n",
       "      <td>7.568493</td>\n",
       "      <td>2.846327</td>\n",
       "      <td>0.002206</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>107.675981</td>\n",
       "      <td>107.669953</td>\n",
       "      <td>3.677115</td>\n",
       "      <td>5.328733</td>\n",
       "      <td>1.465054</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>2.805216</td>\n",
       "      <td>1.517690</td>\n",
       "      <td>4.521464</td>\n",
       "      <td>1.501887</td>\n",
       "      <td>0.006028</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>254.576283</td>\n",
       "      <td>254.574545</td>\n",
       "      <td>4.042884</td>\n",
       "      <td>11.977195</td>\n",
       "      <td>1.425692</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>2.535071</td>\n",
       "      <td>1.132042</td>\n",
       "      <td>3.910024</td>\n",
       "      <td>1.388991</td>\n",
       "      <td>0.001738</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>867.425983</td>\n",
       "      <td>867.422957</td>\n",
       "      <td>4.258796</td>\n",
       "      <td>22.041762</td>\n",
       "      <td>1.093660</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>2.293505</td>\n",
       "      <td>1.232185</td>\n",
       "      <td>4.121481</td>\n",
       "      <td>1.444648</td>\n",
       "      <td>0.003026</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>138.225976</td>\n",
       "      <td>138.219066</td>\n",
       "      <td>3.342914</td>\n",
       "      <td>4.403954</td>\n",
       "      <td>1.145942</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>2.495953</td>\n",
       "      <td>1.615534</td>\n",
       "      <td>4.838674</td>\n",
       "      <td>1.611570</td>\n",
       "      <td>0.006910</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min          max          ptp       mean        std  \\\n",
       "0     4339  0.003053   297.670674   297.667621   7.360739  19.904727   \n",
       "1     4043  0.000494   797.392087   797.391593  18.863889  64.350225   \n",
       "2     4497  0.000164   606.671866   606.671702  13.832706  43.895696   \n",
       "3     4130  0.003210  1091.100096  1091.096886  10.989787  39.771488   \n",
       "4     4246  0.005187   689.207895   689.202708  12.100672  36.260374   \n",
       "..     ...       ...          ...          ...        ...        ...   \n",
       "179   3989  0.002206   208.346355   208.344149   5.190641   8.775557   \n",
       "180   3707  0.006028   107.675981   107.669953   3.677115   5.328733   \n",
       "181   4445  0.001738   254.576283   254.574545   4.042884  11.977195   \n",
       "182   4559  0.003026   867.425983   867.422957   4.258796  22.041762   \n",
       "183   3838  0.006910   138.225976   138.219066   3.342914   4.403954   \n",
       "\n",
       "         nmad       med    median       p16       p84    spread      mode  \\\n",
       "0    1.332610  2.169127  2.169127  1.136318  5.632678  2.248180  0.003053   \n",
       "1    1.327428  1.948240  1.948240  0.876128  9.140801  4.132336  0.000494   \n",
       "2    1.765301  2.172162  2.172162  0.743774  6.839131  3.047679  0.000164   \n",
       "3    1.756563  2.250562  2.250562  0.902891  8.642462  3.869786  0.003210   \n",
       "4    1.613689  2.715130  2.715130  1.192010  6.246969  2.527479  0.005187   \n",
       "..        ...       ...       ...       ...       ...       ...       ...   \n",
       "179  2.777135  3.940981  3.940981  1.875839  7.568493  2.846327  0.002206   \n",
       "180  1.465054  2.805216  2.805216  1.517690  4.521464  1.501887  0.006028   \n",
       "181  1.425692  2.535071  2.535071  1.132042  3.910024  1.388991  0.001738   \n",
       "182  1.093660  2.293505  2.293505  1.232185  4.121481  1.444648  0.003026   \n",
       "183  1.145942  2.495953  2.495953  1.615534  4.838674  1.611570  0.006910   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.009337</td>\n",
       "      <td>1586.922621</td>\n",
       "      <td>1586.913284</td>\n",
       "      <td>11.728639</td>\n",
       "      <td>54.578254</td>\n",
       "      <td>1.849336</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>2.710945</td>\n",
       "      <td>1.191957</td>\n",
       "      <td>8.952492</td>\n",
       "      <td>3.880267</td>\n",
       "      <td>0.009337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.028170</td>\n",
       "      <td>5350.087198</td>\n",
       "      <td>5350.086310</td>\n",
       "      <td>9.951353</td>\n",
       "      <td>137.854460</td>\n",
       "      <td>1.034153</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>1.636611</td>\n",
       "      <td>0.921782</td>\n",
       "      <td>10.570077</td>\n",
       "      <td>5.228412</td>\n",
       "      <td>0.028170</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000007</td>\n",
       "      <td>17.017930</td>\n",
       "      <td>17.016424</td>\n",
       "      <td>1.548698</td>\n",
       "      <td>1.497151</td>\n",
       "      <td>0.411130</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.369011</td>\n",
       "      <td>0.087845</td>\n",
       "      <td>1.439080</td>\n",
       "      <td>0.675617</td>\n",
       "      <td>0.000007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000598</td>\n",
       "      <td>305.096271</td>\n",
       "      <td>305.093050</td>\n",
       "      <td>5.181919</td>\n",
       "      <td>15.633537</td>\n",
       "      <td>1.170797</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>1.619642</td>\n",
       "      <td>0.571162</td>\n",
       "      <td>3.821715</td>\n",
       "      <td>1.475505</td>\n",
       "      <td>0.000598</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.001715</td>\n",
       "      <td>616.924352</td>\n",
       "      <td>616.921670</td>\n",
       "      <td>9.262133</td>\n",
       "      <td>29.014861</td>\n",
       "      <td>1.639866</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>2.427164</td>\n",
       "      <td>1.011007</td>\n",
       "      <td>5.472475</td>\n",
       "      <td>2.140856</td>\n",
       "      <td>0.001715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.006019</td>\n",
       "      <td>1005.461775</td>\n",
       "      <td>1005.458903</td>\n",
       "      <td>13.631376</td>\n",
       "      <td>51.271993</td>\n",
       "      <td>2.197642</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>3.441582</td>\n",
       "      <td>1.434870</td>\n",
       "      <td>8.566359</td>\n",
       "      <td>3.608012</td>\n",
       "      <td>0.006019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.213001</td>\n",
       "      <td>55498.001512</td>\n",
       "      <td>55497.996204</td>\n",
       "      <td>64.996068</td>\n",
       "      <td>1572.526637</td>\n",
       "      <td>6.733989</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>4.950465</td>\n",
       "      <td>65.216577</td>\n",
       "      <td>31.890185</td>\n",
       "      <td>0.213001</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min           max           ptp        mean  \\\n",
       "count   184.000000  184.000000    184.000000    184.000000  184.000000   \n",
       "mean   4275.956522    0.009337   1586.922621   1586.913284   11.728639   \n",
       "std    1022.520436    0.028170   5350.087198   5350.086310    9.951353   \n",
       "min    1013.000000    0.000007     17.017930     17.016424    1.548698   \n",
       "25%    3804.000000    0.000598    305.096271    305.093050    5.181919   \n",
       "50%    4266.000000    0.001715    616.924352    616.921670    9.262133   \n",
       "75%    4703.500000    0.006019   1005.461775   1005.458903   13.631376   \n",
       "max    7479.000000    0.213001  55498.001512  55497.996204   64.996068   \n",
       "\n",
       "               std        nmad         med      median         p16  \\\n",
       "count   184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     54.578254    1.849336    2.710945    2.710945    1.191957   \n",
       "std     137.854460    1.034153    1.636611    1.636611    0.921782   \n",
       "min       1.497151    0.411130    0.369011    0.369011    0.087845   \n",
       "25%      15.633537    1.170797    1.619642    1.619642    0.571162   \n",
       "50%      29.014861    1.639866    2.427164    2.427164    1.011007   \n",
       "75%      51.271993    2.197642    3.441582    3.441582    1.434870   \n",
       "max    1572.526637    6.733989    9.153704    9.153704    4.950465   \n",
       "\n",
       "              p84      spread        mode  \n",
       "count  184.000000  184.000000  184.000000  \n",
       "mean     8.952492    3.880267    0.009337  \n",
       "std     10.570077    5.228412    0.028170  \n",
       "min      1.439080    0.675617    0.000007  \n",
       "25%      3.821715    1.475505    0.000598  \n",
       "50%      5.472475    2.140856    0.001715  \n",
       "75%      8.566359    3.608012    0.006019  \n",
       "max     65.216577   31.890185    0.213001  "
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of cameras are 184\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a89e9d56a4554396abc1506ad10bff17",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(FloatProgress(value=0.0, max=184.0), HTML(value='')))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "final_error = asp.camera_reprojection_error_stats_df('/nobackup/sbhusha1/skysat/proc_rainier/final_paper_submission/revision1/proc_out_rainier_lidar/ba_pinhole_robust_threahold_trans_wt04_rotett00/run-final_residuals_no_loss_function_raw_pixels.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.000450</td>\n",
       "      <td>569.002487</td>\n",
       "      <td>569.002037</td>\n",
       "      <td>3.122816</td>\n",
       "      <td>24.074951</td>\n",
       "      <td>0.650363</td>\n",
       "      <td>1.058835</td>\n",
       "      <td>1.058835</td>\n",
       "      <td>0.508833</td>\n",
       "      <td>1.785412</td>\n",
       "      <td>0.638290</td>\n",
       "      <td>0.000450</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4043</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>595.959045</td>\n",
       "      <td>595.958489</td>\n",
       "      <td>2.587533</td>\n",
       "      <td>22.822792</td>\n",
       "      <td>0.601950</td>\n",
       "      <td>0.762246</td>\n",
       "      <td>0.762246</td>\n",
       "      <td>0.290809</td>\n",
       "      <td>1.527288</td>\n",
       "      <td>0.618239</td>\n",
       "      <td>0.000556</td>\n",
       "      <td>20190827_214711_ssc9d1_0002_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4497</td>\n",
       "      <td>0.002811</td>\n",
       "      <td>339.324994</td>\n",
       "      <td>339.322182</td>\n",
       "      <td>1.932481</td>\n",
       "      <td>16.635560</td>\n",
       "      <td>0.522654</td>\n",
       "      <td>0.758491</td>\n",
       "      <td>0.758491</td>\n",
       "      <td>0.314509</td>\n",
       "      <td>1.381719</td>\n",
       "      <td>0.533605</td>\n",
       "      <td>0.002811</td>\n",
       "      <td>20190827_214711_ssc9d1_0003_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4130</td>\n",
       "      <td>0.000785</td>\n",
       "      <td>451.798847</td>\n",
       "      <td>451.798062</td>\n",
       "      <td>2.161195</td>\n",
       "      <td>18.704252</td>\n",
       "      <td>0.452402</td>\n",
       "      <td>0.658154</td>\n",
       "      <td>0.658154</td>\n",
       "      <td>0.295393</td>\n",
       "      <td>1.303070</td>\n",
       "      <td>0.503839</td>\n",
       "      <td>0.000785</td>\n",
       "      <td>20190827_214711_ssc9d1_0004_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4246</td>\n",
       "      <td>0.007152</td>\n",
       "      <td>594.898384</td>\n",
       "      <td>594.891233</td>\n",
       "      <td>3.781831</td>\n",
       "      <td>36.031950</td>\n",
       "      <td>0.458570</td>\n",
       "      <td>0.641323</td>\n",
       "      <td>0.641323</td>\n",
       "      <td>0.274444</td>\n",
       "      <td>1.235684</td>\n",
       "      <td>0.480620</td>\n",
       "      <td>0.007152</td>\n",
       "      <td>20190827_214711_ssc9d1_0005_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.016907</td>\n",
       "      <td>140.716886</td>\n",
       "      <td>140.699979</td>\n",
       "      <td>3.556937</td>\n",
       "      <td>4.346960</td>\n",
       "      <td>1.555055</td>\n",
       "      <td>3.056473</td>\n",
       "      <td>3.056473</td>\n",
       "      <td>1.584632</td>\n",
       "      <td>5.040992</td>\n",
       "      <td>1.728180</td>\n",
       "      <td>0.016907</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>3707</td>\n",
       "      <td>0.000392</td>\n",
       "      <td>69.118004</td>\n",
       "      <td>69.117612</td>\n",
       "      <td>1.337672</td>\n",
       "      <td>2.546861</td>\n",
       "      <td>0.702985</td>\n",
       "      <td>0.942207</td>\n",
       "      <td>0.942207</td>\n",
       "      <td>0.355092</td>\n",
       "      <td>1.905586</td>\n",
       "      <td>0.775247</td>\n",
       "      <td>0.000392</td>\n",
       "      <td>20190827_214821_ssc9d3_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>4445</td>\n",
       "      <td>0.001442</td>\n",
       "      <td>112.943860</td>\n",
       "      <td>112.942418</td>\n",
       "      <td>1.326611</td>\n",
       "      <td>3.920874</td>\n",
       "      <td>0.686272</td>\n",
       "      <td>0.924783</td>\n",
       "      <td>0.924783</td>\n",
       "      <td>0.350642</td>\n",
       "      <td>1.787824</td>\n",
       "      <td>0.718591</td>\n",
       "      <td>0.001442</td>\n",
       "      <td>20190827_214821_ssc9d3_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>4559</td>\n",
       "      <td>0.000749</td>\n",
       "      <td>675.510873</td>\n",
       "      <td>675.510123</td>\n",
       "      <td>1.874442</td>\n",
       "      <td>18.378822</td>\n",
       "      <td>0.548019</td>\n",
       "      <td>0.639134</td>\n",
       "      <td>0.639134</td>\n",
       "      <td>0.202092</td>\n",
       "      <td>1.360494</td>\n",
       "      <td>0.579201</td>\n",
       "      <td>0.000749</td>\n",
       "      <td>20190827_214821_ssc9d3_0017_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>3838</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>49.731920</td>\n",
       "      <td>49.731760</td>\n",
       "      <td>1.071375</td>\n",
       "      <td>2.081101</td>\n",
       "      <td>0.557920</td>\n",
       "      <td>0.649396</td>\n",
       "      <td>0.649396</td>\n",
       "      <td>0.214344</td>\n",
       "      <td>1.507703</td>\n",
       "      <td>0.646679</td>\n",
       "      <td>0.000160</td>\n",
       "      <td>20190827_214821_ssc9d3_0018_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>184 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min         max         ptp      mean        std      nmad  \\\n",
       "0     4339  0.000450  569.002487  569.002037  3.122816  24.074951  0.650363   \n",
       "1     4043  0.000556  595.959045  595.958489  2.587533  22.822792  0.601950   \n",
       "2     4497  0.002811  339.324994  339.322182  1.932481  16.635560  0.522654   \n",
       "3     4130  0.000785  451.798847  451.798062  2.161195  18.704252  0.452402   \n",
       "4     4246  0.007152  594.898384  594.891233  3.781831  36.031950  0.458570   \n",
       "..     ...       ...         ...         ...       ...        ...       ...   \n",
       "179   3989  0.016907  140.716886  140.699979  3.556937   4.346960  1.555055   \n",
       "180   3707  0.000392   69.118004   69.117612  1.337672   2.546861  0.702985   \n",
       "181   4445  0.001442  112.943860  112.942418  1.326611   3.920874  0.686272   \n",
       "182   4559  0.000749  675.510873  675.510123  1.874442  18.378822  0.548019   \n",
       "183   3838  0.000160   49.731920   49.731760  1.071375   2.081101  0.557920   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    1.058835  1.058835  0.508833  1.785412  0.638290  0.000450   \n",
       "1    0.762246  0.762246  0.290809  1.527288  0.618239  0.000556   \n",
       "2    0.758491  0.758491  0.314509  1.381719  0.533605  0.002811   \n",
       "3    0.658154  0.658154  0.295393  1.303070  0.503839  0.000785   \n",
       "4    0.641323  0.641323  0.274444  1.235684  0.480620  0.007152   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "179  3.056473  3.056473  1.584632  5.040992  1.728180  0.016907   \n",
       "180  0.942207  0.942207  0.355092  1.905586  0.775247  0.000392   \n",
       "181  0.924783  0.924783  0.350642  1.787824  0.718591  0.001442   \n",
       "182  0.639134  0.639134  0.202092  1.360494  0.579201  0.000749   \n",
       "183  0.649396  0.649396  0.214344  1.507703  0.646679  0.000160   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "1    20190827_214711_ssc9d1_0002_basic_panchromatic...  \n",
       "2    20190827_214711_ssc9d1_0003_basic_panchromatic...  \n",
       "3    20190827_214711_ssc9d1_0004_basic_panchromatic...  \n",
       "4    20190827_214711_ssc9d1_0005_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "180  20190827_214821_ssc9d3_0015_basic_panchromatic...  \n",
       "181  20190827_214821_ssc9d3_0016_basic_panchromatic...  \n",
       "182  20190827_214821_ssc9d3_0017_basic_panchromatic...  \n",
       "183  20190827_214821_ssc9d3_0018_basic_panchromatic...  \n",
       "\n",
       "[184 rows x 14 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "      <td>184.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4275.956522</td>\n",
       "      <td>0.001150</td>\n",
       "      <td>196.829663</td>\n",
       "      <td>196.828513</td>\n",
       "      <td>1.853875</td>\n",
       "      <td>7.350563</td>\n",
       "      <td>0.799777</td>\n",
       "      <td>1.050596</td>\n",
       "      <td>1.050596</td>\n",
       "      <td>0.402671</td>\n",
       "      <td>2.118733</td>\n",
       "      <td>0.858031</td>\n",
       "      <td>0.001150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1022.520436</td>\n",
       "      <td>0.001792</td>\n",
       "      <td>237.779650</td>\n",
       "      <td>237.779414</td>\n",
       "      <td>1.404582</td>\n",
       "      <td>10.067090</td>\n",
       "      <td>0.427615</td>\n",
       "      <td>0.573330</td>\n",
       "      <td>0.573330</td>\n",
       "      <td>0.236778</td>\n",
       "      <td>1.051084</td>\n",
       "      <td>0.422881</td>\n",
       "      <td>0.001792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1013.000000</td>\n",
       "      <td>0.000009</td>\n",
       "      <td>9.754321</td>\n",
       "      <td>9.754282</td>\n",
       "      <td>0.590856</td>\n",
       "      <td>0.621418</td>\n",
       "      <td>0.288125</td>\n",
       "      <td>0.366689</td>\n",
       "      <td>0.366689</td>\n",
       "      <td>0.123730</td>\n",
       "      <td>0.828817</td>\n",
       "      <td>0.342689</td>\n",
       "      <td>0.000009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3804.000000</td>\n",
       "      <td>0.000230</td>\n",
       "      <td>49.539620</td>\n",
       "      <td>49.539459</td>\n",
       "      <td>1.067994</td>\n",
       "      <td>1.642774</td>\n",
       "      <td>0.530013</td>\n",
       "      <td>0.658910</td>\n",
       "      <td>0.658910</td>\n",
       "      <td>0.252410</td>\n",
       "      <td>1.436529</td>\n",
       "      <td>0.584587</td>\n",
       "      <td>0.000230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4266.000000</td>\n",
       "      <td>0.000669</td>\n",
       "      <td>103.581195</td>\n",
       "      <td>103.580045</td>\n",
       "      <td>1.450671</td>\n",
       "      <td>2.517228</td>\n",
       "      <td>0.744548</td>\n",
       "      <td>0.930815</td>\n",
       "      <td>0.930815</td>\n",
       "      <td>0.343674</td>\n",
       "      <td>1.954414</td>\n",
       "      <td>0.803922</td>\n",
       "      <td>0.000669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4703.500000</td>\n",
       "      <td>0.001366</td>\n",
       "      <td>243.368880</td>\n",
       "      <td>243.368689</td>\n",
       "      <td>2.221153</td>\n",
       "      <td>8.405220</td>\n",
       "      <td>0.932711</td>\n",
       "      <td>1.211890</td>\n",
       "      <td>1.211890</td>\n",
       "      <td>0.489567</td>\n",
       "      <td>2.454929</td>\n",
       "      <td>0.984876</td>\n",
       "      <td>0.001366</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7479.000000</td>\n",
       "      <td>0.016907</td>\n",
       "      <td>1380.388189</td>\n",
       "      <td>1380.388134</td>\n",
       "      <td>13.812309</td>\n",
       "      <td>58.807733</td>\n",
       "      <td>4.104276</td>\n",
       "      <td>4.510848</td>\n",
       "      <td>4.510848</td>\n",
       "      <td>1.584632</td>\n",
       "      <td>9.482684</td>\n",
       "      <td>4.040262</td>\n",
       "      <td>0.016907</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count         min          max          ptp        mean  \\\n",
       "count   184.000000  184.000000   184.000000   184.000000  184.000000   \n",
       "mean   4275.956522    0.001150   196.829663   196.828513    1.853875   \n",
       "std    1022.520436    0.001792   237.779650   237.779414    1.404582   \n",
       "min    1013.000000    0.000009     9.754321     9.754282    0.590856   \n",
       "25%    3804.000000    0.000230    49.539620    49.539459    1.067994   \n",
       "50%    4266.000000    0.000669   103.581195   103.580045    1.450671   \n",
       "75%    4703.500000    0.001366   243.368880   243.368689    2.221153   \n",
       "max    7479.000000    0.016907  1380.388189  1380.388134   13.812309   \n",
       "\n",
       "              std        nmad         med      median         p16         p84  \\\n",
       "count  184.000000  184.000000  184.000000  184.000000  184.000000  184.000000   \n",
       "mean     7.350563    0.799777    1.050596    1.050596    0.402671    2.118733   \n",
       "std     10.067090    0.427615    0.573330    0.573330    0.236778    1.051084   \n",
       "min      0.621418    0.288125    0.366689    0.366689    0.123730    0.828817   \n",
       "25%      1.642774    0.530013    0.658910    0.658910    0.252410    1.436529   \n",
       "50%      2.517228    0.744548    0.930815    0.930815    0.343674    1.954414   \n",
       "75%      8.405220    0.932711    1.211890    1.211890    0.489567    2.454929   \n",
       "max     58.807733    4.104276    4.510848    4.510848    1.584632    9.482684   \n",
       "\n",
       "           spread        mode  \n",
       "count  184.000000  184.000000  \n",
       "mean     0.858031    0.001150  \n",
       "std      0.422881    0.001792  \n",
       "min      0.342689    0.000009  \n",
       "25%      0.584587    0.000230  \n",
       "50%      0.803922    0.000669  \n",
       "75%      0.984876    0.001366  \n",
       "max      4.040262    0.016907  "
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "      <th>camera</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4339</td>\n",
       "      <td>0.000450</td>\n",
       "      <td>569.002487</td>\n",
       "      <td>569.002037</td>\n",
       "      <td>3.122816</td>\n",
       "      <td>24.074951</td>\n",
       "      <td>0.650363</td>\n",
       "      <td>1.058835</td>\n",
       "      <td>1.058835</td>\n",
       "      <td>0.508833</td>\n",
       "      <td>1.785412</td>\n",
       "      <td>0.638290</td>\n",
       "      <td>0.000450</td>\n",
       "      <td>20190827_214711_ssc9d1_0001_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4400</td>\n",
       "      <td>0.001135</td>\n",
       "      <td>665.714445</td>\n",
       "      <td>665.713310</td>\n",
       "      <td>3.919193</td>\n",
       "      <td>36.287373</td>\n",
       "      <td>0.759539</td>\n",
       "      <td>1.055000</td>\n",
       "      <td>1.055000</td>\n",
       "      <td>0.455801</td>\n",
       "      <td>2.066563</td>\n",
       "      <td>0.805381</td>\n",
       "      <td>0.001135</td>\n",
       "      <td>20190827_214711_ssc9d1_0007_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>4110</td>\n",
       "      <td>0.006242</td>\n",
       "      <td>564.271388</td>\n",
       "      <td>564.265146</td>\n",
       "      <td>3.245455</td>\n",
       "      <td>26.593021</td>\n",
       "      <td>0.638084</td>\n",
       "      <td>1.049758</td>\n",
       "      <td>1.049758</td>\n",
       "      <td>0.479943</td>\n",
       "      <td>1.764237</td>\n",
       "      <td>0.642147</td>\n",
       "      <td>0.006242</td>\n",
       "      <td>20190827_214711_ssc9d1_0011_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>3739</td>\n",
       "      <td>0.002633</td>\n",
       "      <td>376.004816</td>\n",
       "      <td>376.002183</td>\n",
       "      <td>3.223589</td>\n",
       "      <td>19.882389</td>\n",
       "      <td>0.935517</td>\n",
       "      <td>1.321495</td>\n",
       "      <td>1.321495</td>\n",
       "      <td>0.533881</td>\n",
       "      <td>2.408029</td>\n",
       "      <td>0.937074</td>\n",
       "      <td>0.002633</td>\n",
       "      <td>20190827_214711_ssc9d1_0015_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>3634</td>\n",
       "      <td>0.005111</td>\n",
       "      <td>298.208740</td>\n",
       "      <td>298.203629</td>\n",
       "      <td>1.741225</td>\n",
       "      <td>6.106278</td>\n",
       "      <td>0.937438</td>\n",
       "      <td>1.294144</td>\n",
       "      <td>1.294144</td>\n",
       "      <td>0.501099</td>\n",
       "      <td>2.415203</td>\n",
       "      <td>0.957052</td>\n",
       "      <td>0.005111</td>\n",
       "      <td>20190827_214711_ssc9d1_0016_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>3527</td>\n",
       "      <td>0.000121</td>\n",
       "      <td>144.952959</td>\n",
       "      <td>144.952838</td>\n",
       "      <td>1.850244</td>\n",
       "      <td>6.730532</td>\n",
       "      <td>0.973489</td>\n",
       "      <td>1.022700</td>\n",
       "      <td>1.022700</td>\n",
       "      <td>0.292867</td>\n",
       "      <td>2.507979</td>\n",
       "      <td>1.107556</td>\n",
       "      <td>0.000121</td>\n",
       "      <td>20190827_214821_ssc9d3_0010_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>4393</td>\n",
       "      <td>0.002946</td>\n",
       "      <td>118.794059</td>\n",
       "      <td>118.791113</td>\n",
       "      <td>2.018989</td>\n",
       "      <td>2.901077</td>\n",
       "      <td>1.168762</td>\n",
       "      <td>1.601593</td>\n",
       "      <td>1.601593</td>\n",
       "      <td>0.638628</td>\n",
       "      <td>3.164065</td>\n",
       "      <td>1.262719</td>\n",
       "      <td>0.002946</td>\n",
       "      <td>20190827_214821_ssc9d3_0011_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>3987</td>\n",
       "      <td>0.000110</td>\n",
       "      <td>203.279158</td>\n",
       "      <td>203.279049</td>\n",
       "      <td>1.664255</td>\n",
       "      <td>4.530552</td>\n",
       "      <td>0.984487</td>\n",
       "      <td>1.156057</td>\n",
       "      <td>1.156057</td>\n",
       "      <td>0.394604</td>\n",
       "      <td>2.525250</td>\n",
       "      <td>1.065323</td>\n",
       "      <td>0.000110</td>\n",
       "      <td>20190827_214821_ssc9d3_0012_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>4412</td>\n",
       "      <td>0.001811</td>\n",
       "      <td>77.834154</td>\n",
       "      <td>77.832343</td>\n",
       "      <td>1.782951</td>\n",
       "      <td>3.117000</td>\n",
       "      <td>0.970170</td>\n",
       "      <td>1.395978</td>\n",
       "      <td>1.395978</td>\n",
       "      <td>0.556630</td>\n",
       "      <td>2.517670</td>\n",
       "      <td>0.980520</td>\n",
       "      <td>0.001811</td>\n",
       "      <td>20190827_214821_ssc9d3_0013_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>3989</td>\n",
       "      <td>0.016907</td>\n",
       "      <td>140.716886</td>\n",
       "      <td>140.699979</td>\n",
       "      <td>3.556937</td>\n",
       "      <td>4.346960</td>\n",
       "      <td>1.555055</td>\n",
       "      <td>3.056473</td>\n",
       "      <td>3.056473</td>\n",
       "      <td>1.584632</td>\n",
       "      <td>5.040992</td>\n",
       "      <td>1.728180</td>\n",
       "      <td>0.016907</td>\n",
       "      <td>20190827_214821_ssc9d3_0014_basic_panchromatic...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>82 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     count       min         max         ptp      mean        std      nmad  \\\n",
       "0     4339  0.000450  569.002487  569.002037  3.122816  24.074951  0.650363   \n",
       "6     4400  0.001135  665.714445  665.713310  3.919193  36.287373  0.759539   \n",
       "10    4110  0.006242  564.271388  564.265146  3.245455  26.593021  0.638084   \n",
       "14    3739  0.002633  376.004816  376.002183  3.223589  19.882389  0.935517   \n",
       "15    3634  0.005111  298.208740  298.203629  1.741225   6.106278  0.937438   \n",
       "..     ...       ...         ...         ...       ...        ...       ...   \n",
       "175   3527  0.000121  144.952959  144.952838  1.850244   6.730532  0.973489   \n",
       "176   4393  0.002946  118.794059  118.791113  2.018989   2.901077  1.168762   \n",
       "177   3987  0.000110  203.279158  203.279049  1.664255   4.530552  0.984487   \n",
       "178   4412  0.001811   77.834154   77.832343  1.782951   3.117000  0.970170   \n",
       "179   3989  0.016907  140.716886  140.699979  3.556937   4.346960  1.555055   \n",
       "\n",
       "          med    median       p16       p84    spread      mode  \\\n",
       "0    1.058835  1.058835  0.508833  1.785412  0.638290  0.000450   \n",
       "6    1.055000  1.055000  0.455801  2.066563  0.805381  0.001135   \n",
       "10   1.049758  1.049758  0.479943  1.764237  0.642147  0.006242   \n",
       "14   1.321495  1.321495  0.533881  2.408029  0.937074  0.002633   \n",
       "15   1.294144  1.294144  0.501099  2.415203  0.957052  0.005111   \n",
       "..        ...       ...       ...       ...       ...       ...   \n",
       "175  1.022700  1.022700  0.292867  2.507979  1.107556  0.000121   \n",
       "176  1.601593  1.601593  0.638628  3.164065  1.262719  0.002946   \n",
       "177  1.156057  1.156057  0.394604  2.525250  1.065323  0.000110   \n",
       "178  1.395978  1.395978  0.556630  2.517670  0.980520  0.001811   \n",
       "179  3.056473  3.056473  1.584632  5.040992  1.728180  0.016907   \n",
       "\n",
       "                                                camera  \n",
       "0    20190827_214711_ssc9d1_0001_basic_panchromatic...  \n",
       "6    20190827_214711_ssc9d1_0007_basic_panchromatic...  \n",
       "10   20190827_214711_ssc9d1_0011_basic_panchromatic...  \n",
       "14   20190827_214711_ssc9d1_0015_basic_panchromatic...  \n",
       "15   20190827_214711_ssc9d1_0016_basic_panchromatic...  \n",
       "..                                                 ...  \n",
       "175  20190827_214821_ssc9d3_0010_basic_panchromatic...  \n",
       "176  20190827_214821_ssc9d3_0011_basic_panchromatic...  \n",
       "177  20190827_214821_ssc9d3_0012_basic_panchromatic...  \n",
       "178  20190827_214821_ssc9d3_0013_basic_panchromatic...  \n",
       "179  20190827_214821_ssc9d3_0014_basic_panchromatic...  \n",
       "\n",
       "[82 rows x 14 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_error[final_error['median']>1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A constrained translation with toatally free rotation was not able to properly optmize 82 cameras, even though having a high robust threshold and parameter tolerance. One interesting analysis is to analyse the initial median pixel reprojection errors for these cameras."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>ptp</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>nmad</th>\n",
       "      <th>med</th>\n",
       "      <th>median</th>\n",
       "      <th>p16</th>\n",
       "      <th>p84</th>\n",
       "      <th>spread</th>\n",
       "      <th>mode</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "      <td>82.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>4094.121951</td>\n",
       "      <td>0.016943</td>\n",
       "      <td>1243.079006</td>\n",
       "      <td>1243.062063</td>\n",
       "      <td>12.355781</td>\n",
       "      <td>44.429678</td>\n",
       "      <td>2.494001</td>\n",
       "      <td>3.758417</td>\n",
       "      <td>3.758417</td>\n",
       "      <td>1.665665</td>\n",
       "      <td>10.281162</td>\n",
       "      <td>4.307748</td>\n",
       "      <td>0.016943</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1029.429812</td>\n",
       "      <td>0.040128</td>\n",
       "      <td>3227.846183</td>\n",
       "      <td>3227.845867</td>\n",
       "      <td>8.361374</td>\n",
       "      <td>62.037038</td>\n",
       "      <td>1.041755</td>\n",
       "      <td>1.674087</td>\n",
       "      <td>1.674087</td>\n",
       "      <td>1.059140</td>\n",
       "      <td>9.724672</td>\n",
       "      <td>4.815830</td>\n",
       "      <td>0.040128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1557.000000</td>\n",
       "      <td>0.000008</td>\n",
       "      <td>71.300090</td>\n",
       "      <td>71.290441</td>\n",
       "      <td>2.942447</td>\n",
       "      <td>3.434295</td>\n",
       "      <td>1.173029</td>\n",
       "      <td>1.339886</td>\n",
       "      <td>1.339886</td>\n",
       "      <td>0.411875</td>\n",
       "      <td>2.993550</td>\n",
       "      <td>1.285338</td>\n",
       "      <td>0.000008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3542.250000</td>\n",
       "      <td>0.001343</td>\n",
       "      <td>285.153317</td>\n",
       "      <td>285.152103</td>\n",
       "      <td>6.429561</td>\n",
       "      <td>15.008262</td>\n",
       "      <td>1.753862</td>\n",
       "      <td>2.491075</td>\n",
       "      <td>2.491075</td>\n",
       "      <td>0.941572</td>\n",
       "      <td>5.337467</td>\n",
       "      <td>2.058354</td>\n",
       "      <td>0.001343</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>4078.000000</td>\n",
       "      <td>0.004113</td>\n",
       "      <td>615.207619</td>\n",
       "      <td>615.190912</td>\n",
       "      <td>10.327783</td>\n",
       "      <td>29.007755</td>\n",
       "      <td>2.194354</td>\n",
       "      <td>3.444837</td>\n",
       "      <td>3.444837</td>\n",
       "      <td>1.261001</td>\n",
       "      <td>7.434180</td>\n",
       "      <td>2.854183</td>\n",
       "      <td>0.004113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>4542.500000</td>\n",
       "      <td>0.012812</td>\n",
       "      <td>1157.230505</td>\n",
       "      <td>1157.214431</td>\n",
       "      <td>15.289459</td>\n",
       "      <td>52.228994</td>\n",
       "      <td>3.059508</td>\n",
       "      <td>4.315028</td>\n",
       "      <td>4.315028</td>\n",
       "      <td>1.983067</td>\n",
       "      <td>9.671398</td>\n",
       "      <td>3.935519</td>\n",
       "      <td>0.012812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>6811.000000</td>\n",
       "      <td>0.213001</td>\n",
       "      <td>28952.229330</td>\n",
       "      <td>28952.215595</td>\n",
       "      <td>46.034227</td>\n",
       "      <td>531.611488</td>\n",
       "      <td>6.733989</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>9.153704</td>\n",
       "      <td>4.950465</td>\n",
       "      <td>61.545602</td>\n",
       "      <td>30.128732</td>\n",
       "      <td>0.213001</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             count        min           max           ptp       mean  \\\n",
       "count    82.000000  82.000000     82.000000     82.000000  82.000000   \n",
       "mean   4094.121951   0.016943   1243.079006   1243.062063  12.355781   \n",
       "std    1029.429812   0.040128   3227.846183   3227.845867   8.361374   \n",
       "min    1557.000000   0.000008     71.300090     71.290441   2.942447   \n",
       "25%    3542.250000   0.001343    285.153317    285.152103   6.429561   \n",
       "50%    4078.000000   0.004113    615.207619    615.190912  10.327783   \n",
       "75%    4542.500000   0.012812   1157.230505   1157.214431  15.289459   \n",
       "max    6811.000000   0.213001  28952.229330  28952.215595  46.034227   \n",
       "\n",
       "              std       nmad        med     median        p16        p84  \\\n",
       "count   82.000000  82.000000  82.000000  82.000000  82.000000  82.000000   \n",
       "mean    44.429678   2.494001   3.758417   3.758417   1.665665  10.281162   \n",
       "std     62.037038   1.041755   1.674087   1.674087   1.059140   9.724672   \n",
       "min      3.434295   1.173029   1.339886   1.339886   0.411875   2.993550   \n",
       "25%     15.008262   1.753862   2.491075   2.491075   0.941572   5.337467   \n",
       "50%     29.007755   2.194354   3.444837   3.444837   1.261001   7.434180   \n",
       "75%     52.228994   3.059508   4.315028   4.315028   1.983067   9.671398   \n",
       "max    531.611488   6.733989   9.153704   9.153704   4.950465  61.545602   \n",
       "\n",
       "          spread       mode  \n",
       "count  82.000000  82.000000  \n",
       "mean    4.307748   0.016943  \n",
       "std     4.815830   0.040128  \n",
       "min     1.285338   0.000008  \n",
       "25%     2.058354   0.001343  \n",
       "50%     2.854183   0.004113  \n",
       "75%     3.935519   0.012812  \n",
       "max    30.128732   0.213001  "
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "init_error[final_error['median']>1].describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So basically 25% of these cameras had initial median pixel reporjection error higher than 2.5 px, and 50% more than 3.44 px, which failed to improve after the translation constrained bundle adjustment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
